Skip to content

Commit

Permalink
Merge pull request #64 from ArjenMiedema/implement-laravel-coding-sta…
Browse files Browse the repository at this point in the history
…ndards

Implement Laravel coding standards
  • Loading branch information
leonhelmus authored Mar 26, 2021
2 parents 7ac0b41 + 2f3f54a commit c8e49db
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Installer/PackagesInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ class PackagesInstaller implements InstallerInterface
'name' => 'mediact/coding-standard-magento2',
'version' => '@stable'
]
],
'laravel' => [
[
'name' => 'elgentos/laravel-coding-standard',
'version' => '@stable'
]
]
];

Expand All @@ -53,7 +59,7 @@ class PackagesInstaller implements InstallerInterface
* @param ProjectTypeResolver $typeResolver
* @param IOInterface $io
* @param DependencyInstaller|null $installer
* @param array $mapping
* @param array|null $mapping
*/
public function __construct(
Composer $composer,
Expand Down
1 change: 1 addition & 0 deletions src/ProjectTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ProjectTypeResolver
'magento2-project' => 'magento2',
'magento-project' => 'magento2',
'alumio-project' => 'alumio',
'laravel-project' => 'laravel',
];

/**
Expand Down
18 changes: 18 additions & 0 deletions templates/files/laravel/bitbucket-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
image: srcoder/development-php:php74-fpm
definitions:
caches:
vendor: vendor
pipelines:
default:
- step:
name: Testing suite
caches:
- composer
- vendor
script:
- composer self-update
- if [ -f "composer.lock" ]; then composer check-platform-reqs; fi
- if [ -n "$COMPOSER_PRE_INSTALL_CALLBACK" ]; then eval $COMPOSER_PRE_INSTALL_CALLBACK; fi
- composer install --dev --prefer-dist --no-scripts --no-progress --optimize-autoloader --no-interaction -vvv
- composer show
- composer exec -v grumphp run
3 changes: 3 additions & 0 deletions templates/files/laravel/dotgitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Do not commit project install files.
/vendor
/composer.lock
2 changes: 2 additions & 0 deletions templates/files/laravel/grumphp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports:
- resource: 'vendor/mediact/testing-suite/config/default/grumphp.yml'
11 changes: 11 additions & 0 deletions templates/files/laravel/pdepend.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<symfony:container xmlns:symfony="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://pdepend.org/schema/dic/pdepend"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<config>
<cache>
<driver>memory</driver>
</cache>
</config>
</symfony:container>
10 changes: 10 additions & 0 deletions templates/files/laravel/phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset name="PHPCS"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>PHPCS</description>
<!--<exclude-pattern>path/to/exclude/*</exclude-pattern>-->
<rule ref="./vendor/elgentos/laravel-coding-standard/src/ElgentosLaravel"/>
</ruleset>
10 changes: 10 additions & 0 deletions templates/files/laravel/phpmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<ruleset name="PHPMD"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>PHPMD</description>
<!--<exclude-pattern>path/to/exclude/*</exclude-pattern>-->
<rule ref="./vendor/elgentos/laravel-coding-standard/src/ElgentosLaravel/phpmd.xml" />
</ruleset>
3 changes: 3 additions & 0 deletions templates/files/laravel/phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
parameters:
excludes_analyse:
# - %rootDir%/../../../path/to/exclude/*
3 changes: 3 additions & 0 deletions templates/mapping/project/laravel
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{laravel/,}phpcs.xml
{laravel/,}phpmd.xml
{laravel/,}phpstan.neon

0 comments on commit c8e49db

Please sign in to comment.