Giter VIP home page Giter VIP logo

symplify's Introduction





Symplify - Making Everyday PHP Development Simple


In this monorepo you'll find PHP packages that help you with:

  • your first coding standard
  • maintenance of monorepo and changelog
  • clean Kernel even with Flex loading methods
  • slim and re-usable Symfony configs

You'll find all packages in /packages directory. Here is a brief overview (tip: click on the package name to see its README with more detailed features):

Coding Standards

For Symfony

For Package Development

For Any Developer

For PHPStan Lovers

For CI Keeping you Safe


Contributing & Issues

If you have issue and want to improve some package, put it all into this repository.

Fork and clone your repository:

git clone [email protected]:<your-name>/symplify.git
cd symplify
composer install

3 Steps to Contribute

  • 1 feature per pull-request

  • new feature must have tests

  • tests and static analysis must pass:

    vendor/bin/phpunit
    composer phpstan

We would be happy to merge your feature then 👍

symplify's People

Contributors

addshore avatar azdanov avatar c33s avatar carusogabriel avatar crazko avatar dg avatar enumag avatar github-actions[bot] avatar janatjak avatar janmikes avatar jawira avatar jibbarth avatar kodiakhq[bot] avatar leoloso avatar liarco avatar lulco avatar mantiz avatar muglug avatar natepage avatar ondram avatar orklah avatar ostrolucky avatar rarst avatar ruudk avatar samsonasik avatar seb-jean avatar staabm avatar tomasfejfar avatar tomasvotruba avatar zingimmick avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

symplify's Issues

[DefaultAutowire] Incompatibility with symfony/monolog-bundle 3.0

Steps to reproduce:

symfony new monolog-test
cd monolog-test/
composer require symplify/default-autowire
php bin/console server:start

Now add DefaultAutowireBundle to AppKernel.php.

In the browser you should see this error.

Unable to autowire argument index 1 ($excludedUrls) for the service "monolog.activation_strategy.not_found". If this is an object, give it a type-hint. Otherwise, specify this argument's value explicitly.

[ControllerAutowire] Trait with default methods

What do you think about trait with methods from Symfony\Bundle\FrameworkBundle\Controller\Controller? It can be preatty dificult for new users replace $this->render('default/index.html.twig'); for $this->template->renderResponse('default/index.html.twig');. Also if you want use this extension in the middle of project, you simply can't because you call render method everywhere and it's falls.

For example, in Controller is method render which contents return $this->container->get('templating')->renderResponse($view, $parameters, $response);

This trait could inject doctrine like https://github.com/Olicek/ControllerAutowire/blob/inject-default-dependencies/src/DependencyInjection/Compiler/InjectDependenciesPass.php#L82

and trait looks like https://github.com/Olicek/ControllerAutowire/blob/inject-default-dependencies/src/DependencyInjection/DoctrineAwareTrait.php

[CodingStandard] refactoring sniffs

Inspiration by @tomasfejfar: "Teď když je statická analýza, tak by bylo super mít možnost machine-readable refaktoringu! Jakože refaktoruješ ve frameworku a k releasu přiložíš machine-readable refaktoring předpis, který si můžou lidi pustit a ono jim to opraví jejch codebase."

[TwitterBrandBuilder]

Nápady:

  • retweet ty dříve důležité tweety - recyklovat automaticky nejlepší obsah
  • dávkovat to - přidat vlastní frontu a nestarat se o to

[Statie] Nicer error messages

When generating static output, an exception often came out to me with a message like this:

Unexpected token ',' on line 2.

But from the message I couldn't tell which file is affected, only that it happened when compiling latte templates.

Could it nicely print out at least a filename, which had been processed when the exception was thrown, please?

Thanks for a great tool!

[CodingStandard] sniff ideas

Anti-shortcut naming sniff

No

  • EntityManager => $em
  • Application => $app
  • EventManger => $evm

Yea

  • EntityManager => $entityManager
  • Application => $application
  • EventManger => $eventManager

[CodingStandard] Add support for wildcards check like phpunit has

Use case:

"check-cs": [
    "vendor/bin/symplify-cs check src/ActionAutowire/src",
    "vendor/bin/symplify-cs check src/ActionAutowire/tests",
    "vendor/bin/symplify-cs check src/AutoServiceRegistration/src",
    "vendor/bin/symplify-cs check src/AutoServiceRegistration/tests",
    "vendor/bin/symplify-cs check src/CodingStandard/src",
    "vendor/bin/symplify-cs check src/CodingStandard/tests",
    "vendor/bin/symplify-cs check src/DefaultAutowire/src",
    "vendor/bin/symplify-cs check src/DefaultAutowire/tests",
    "vendor/bin/symplify-cs check src/ModularDoctrineFilters/src",
    "vendor/bin/symplify-cs check src/ModularDoctrineFilters/tests",
    "vendor/bin/symplify-cs check src/ModularRouting/src",
    "vendor/bin/symplify-cs check src/ModularRouting/tests",
    "vendor/bin/symplify-cs check src/NetteAdapterForSymfonyBundles/src",
    "vendor/bin/symplify-cs check src/NetteAdapterForSymfonyBundles/tests"
],

Desired output:

"check-cs": [
    "vendor/bin/symplify-cs check src/*/src",
    "vendor/bin/symplify-cs check src/*/tests"
],

Inspired by phpunit.xml:

<phpunit
    bootstrap="tests/bootstrap.php"
    colors="true"
>
    <testsuites>
        <testsuite>
            <directory>src/*/tests</directory>
        </testsuite>
    </testsuites>
    <filter>
        <whitelist>
            <directory suffix=".php">src/*/src</directory>
        </whitelist>
    </filter>
</phpunit>

Statie: Running tests fails & deletes everything

Cloned Statie into /tmp/Statie, installed dependencies and ran PHPUnit. Boom, everything disappeared!

$ ll
total 144
drwxr-xr-x  2 majkl majkl     80 Feb 23 20:47 bin
-rw-r--r--  1 majkl majkl   1298 Feb 23 20:47 composer.json
-rw-r--r--  1 majkl majkl 127347 Feb 23 20:47 composer.lock
drwxr-xr-x  2 majkl majkl     60 Feb 23 20:47 docs
-rw-r--r--  1 majkl majkl   1075 Feb 23 20:47 LICENSE
-rw-r--r--  1 majkl majkl    419 Feb 23 20:47 phpunit.xml
-rw-r--r--  1 majkl majkl   3833 Feb 23 20:47 README.md
drwxr-xr-x 17 majkl majkl    340 Feb 23 20:47 src
drwxr-xr-x 12 majkl majkl    240 Feb 23 20:47 tests
drwxr-xr-x 28 majkl majkl    580 Feb 23 20:47 vendor

$ vendor/bin/phpunit 
PHPUnit 5.7.14 by Sebastian Bergmann and contributors.

.PHP Warning:  include(/tmp/Statie/vendor/composer/../phpunit/phpunit/src/Framework/TestFailure.php): failed to open stream: No such file or directory in /tmp/Statie/vendor/composer/ClassLoader.php on line 414

Warning: include(/tmp/Statie/vendor/composer/../phpunit/phpunit/src/Framework/TestFailure.php): failed to open stream: No such file or directory in /tmp/Statie/vendor/composer/ClassLoader.php on line 414
PHP Warning:  include(): Failed opening '/tmp/Statie/vendor/composer/../phpunit/phpunit/src/Framework/TestFailure.php' for inclusion (include_path='.:/usr/local/share/pear') in /tmp/Statie/vendor/composer/ClassLoader.php on line 414

Warning: include(): Failed opening '/tmp/Statie/vendor/composer/../phpunit/phpunit/src/Framework/TestFailure.php' for inclusion (include_path='.:/usr/local/share/pear') in /tmp/Statie/vendor/composer/ClassLoader.php on line 414
PHP Fatal error:  Uncaught Error: Class 'PHPUnit_Framework_TestFailure' not found in /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestResult.php:250
Stack trace:
#0 /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestResult.php(862): PHPUnit_Framework_TestResult->addError(Object(Symplify\Statie\Tests\Application\StatieApplicationTest), Object(PHPUnit_Framework_Error_Warning), 0.032729148864746)
#1 /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestCase.php(926): PHPUnit_Framework_TestResult->run(Object(Symplify\Statie\Tests\Application\StatieApplicationTest))
#2 /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestSuite.php(728): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
#3 /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestSuite.php(728): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#4 /tmp/Statie/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(521): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#5 /tmp/Statie/vendor/phpunit/phpunit/src/T in /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestResult.php on line 250

Fatal error: Uncaught Error: Class 'PHPUnit_Framework_TestFailure' not found in /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestResult.php:250
Stack trace:
#0 /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestResult.php(862): PHPUnit_Framework_TestResult->addError(Object(Symplify\Statie\Tests\Application\StatieApplicationTest), Object(PHPUnit_Framework_Error_Warning), 0.032729148864746)
#1 /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestCase.php(926): PHPUnit_Framework_TestResult->run(Object(Symplify\Statie\Tests\Application\StatieApplicationTest))
#2 /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestSuite.php(728): PHPUnit_Framework_TestCase->run(Object(PHPUnit_Framework_TestResult))
#3 /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestSuite.php(728): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#4 /tmp/Statie/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(521): PHPUnit_Framework_TestSuite->run(Object(PHPUnit_Framework_TestResult))
#5 /tmp/Statie/vendor/phpunit/phpunit/src/T in /tmp/Statie/vendor/phpunit/phpunit/src/Framework/TestResult.php on line 250

$ ll
total 0

Setup structure

The goal?

I want to check README and use the package

Not:

  • to study
  • to hope tests passes
  • not-now the real coveage, because passing tests mean nothing
  • not to google or stackoverflow to make it work

"Every repository sets example to other packages. Think of it while making it."


I want the repository to be as convenient to the end users as it can be.
I want to combine best of both worlds:

  • easy to maintain (monorepo)
  • and easy to use (split repo)

Also:

  • easy to fork
  • easy to run tests on

TODO

  • consider moving from /src to /packages, since there is double /src now for no reason and packages is the correct name

[ControllerAutowire] Unable to inject for controllers in sub directories

So if we've got some controllers in sub directories like

.
└── Carbon
    ├── DashboardBundle
    │   ├── CarbonDashboardBundle.php
    │   └── Controller
    │       ├── DashboardController.php
    │       └── Manager
    │           └── Dashboard.php

Currently its unable to auto wire dependencies for Carbon\DashboardBundle\Controller\Manager\Dashboard Class.

[CodingStandard] sniff ideas

AST Refactors

  • Moved to Rector

  • sniffs teaching defensive programing - https://ocramius.github.io/extremely-defensive-php

  • refactor named service to typed service in Symfony

    • get container map

    • replace string by type

    • or by interface that implements

    • configurable

      # name: type
      doctrine.entity_manager: Doctrine\ORM\EntityManagerInterface   

Finished Ideas

Outsourced

Statie: Found section 'application' in configuration, but corresponding extension is missing

When running a Travis job after pushing to master, I keep getting the following fatal error:

$ if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then
    vendor/bin/statie push-to-github ikvasnica/ikvasnica.com --token=${GH_TOKEN}
fi
PHP Fatal error:  Uncaught Nette\InvalidStateException: Found section 'application' in configuration, but corresponding extension is missing. in /home/travis/build/ikvasnica/ikvasnica.com/vendor/nette/di/src/DI/Compiler.php:224

Requiring nette/application in dependencies fixed the issue.

[Statie] Sometimes the page is not regenerated

When I work with statie on pehapkari.cz it happens from time to time that the files are not regenerated. Only fix is to restart the server command.

As a first step towards debugging this issue could be logging when regeneration happens.

[EasyCodingStandard] Option to disable printing out fixed code

Copied from old repo, not sure if still an issue.

"It would be handy if there could be an option to hide fixed code which is printed out everytime the script is run.
Either in multi-cs.json or as commandline argument passed to the batch file.

If the script is processing many files, the output on commandline is too large and often the fixed code display is unneccessary."

by @jindrapetrik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.