My message to you is, our work requires a great passion and energy to continuously evolve but this process it doesn’t have to be hard, in fact is has to be easy and help you save time on boring parts and let you focused just on the most interesting parts of the development.
12. With
Installation made easy
composer create-project
--repository-url=https://repo.magento.com/
magento/project-community-edition magento2
Update made easy
composer require
magento/product-community-edition 2.1.9 --no-update
composer update
12
Source http://devdocs.magento.com/guides/v2.2/comp-mgr/cli/cli-upgrade.html
13. How
Composer is exactly like…. a composer. In this case
Magento 2 is a musical and the packages installed are
the members of the orchestra. You can’t have a live
musical without the orchestra and you can’t have
Magento 2 without its packages.
from digital agency Creare
13
Source https://magento.com/resources/harnessing-power-composer-magento-2
19. How
With 4 minutes of your time
( actually less but I am slow)
Tell PHPStorm where to find PHPUnit
{{magento_root}}/vendor/phpunit/phpunit/phpunit
19
Source http://devdocs.magento.com/guides/v2.2/test/unit/unit_test_execution_phpstorm.html
20. How
With 4 minutes of your time
( actually less but I am slow)
Tell PHPStorm which configuration file to use
{{magento_root}}/dev/tests/unit/phpunit.xml.dist
20
Source http://devdocs.magento.com/guides/v2.2/test/unit/unit_test_execution_phpstorm.html
21. How
With 4 minutes of your time
( actually less but I am slow)
Press the button Run all tests or run it from terminal
21
Source http://devdocs.magento.com/guides/v2.2/test/unit/unit_test_execution_phpstorm.html
php {{magento_root}}/vendor/phpunit/phpunit/phpunit
--configuration {{magento_root}}/dev/tests/unit/phpunit.xml.dist
23. With 1. Learning Magento 2
2. Bug Free code
3. Bugfixing
4. And avoid this….
23
24. Avoid
24
@note it's impossible to mock an order in Magento 1
* I can't ok? I give up, cost me 1 hour and still didn't get anywhere
* So there you have it, I failed, happy now?!
* If you're looking for me I'll be in a corner crying and wishing for Magento 2
Anonymous Source
27. How
With 2 minutes of your time
Tell PHPStorm where to find PHPCodesniffer
{{magento_root}}/vendor/bin/phpcs
27
Source http://devdocs.magento.com/guides/v2.2/coding-standards/code-standard-sniffers.html
28. How
With 2 minutes of your time
Tell PHPStorm where to find ruleset.xml
{{magento_root}}/dev/tests/static/framework/Magento/
28
Source http://devdocs.magento.com/guides/v2.2/coding-standards/code-standard-sniffers.html
30. After 2 minutes of your time
You’ll have your personal teacher and your pair programmer.
30
Source http://devdocs.magento.com/guides/v2.2/coding-standards/code-standard-sniffers.html
31. With
1. Improve your knowledge of PHP
2. Improve your coding style
3. Enforce a standard inside your team
4. Bugfixing
31
34. 34
Tabs VS Spaces
Anyone?
( except Marius that is b*tching positively)
Source http://www.php-fig.org/psr/psr-2/
Quiz
time
35. 35
Tabs VS Spaces
Anyone?
PSR-2 2.4. Indenting
Code MUST use an indent of 4 spaces, and MUST NOT use tabs for
indenting.
N.b.: helps to avoid problems with diffs, patches, history, and annotations.
Source http://www.php-fig.org/psr/psr-2/
Quiz
time
37. How
With 2 minutes of your time
Tell PHPStorm where to find PHPMD
{{magento_root}}/vendor/bin/phpmd
37
38. How
With 2 minutes of your time
Tell PHPStorm where to find ruleset.xml
{{magento_root}}/dev/tests/static/testsuite/Magento/Tes
t/Php/_files/phpmd/
38