File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM splitbrain/phpfarm:jessie
1+ FROM debian:trixie-slim
22
3- RUN apt-get update && apt-get install -y git zip
3+ # Prevent interactive prompts
4+ ENV DEBIAN_FRONTEND=noninteractive
45
6+ # Install dependencies
7+ RUN apt-get update && apt-get install -y \
8+ apt-transport-https \
9+ ca-certificates \
10+ curl \
11+ git \
12+ lsb-release \
13+ unzip \
14+ zip \
15+ && curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg \
16+ && echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list \
17+ && apt-get update
18+
19+ # Supported PHP Versions
20+ ENV PHP_VERSIONS="7.4 8.0 8.1 8.2 8.3 8.4 8.5"
21+
22+ # Install all PHP versions using a loop
23+ RUN for ver in $PHP_VERSIONS; do \
24+ apt-get install -y \
25+ php${ver}-cli php${ver}-xml php${ver}-mbstring php${ver}-soap; \
26+ done \
27+ && apt-get clean && rm -rf /var/lib/apt/lists/*
28+
29+ # Create symlinks (php-X.Y) using the same list
30+ RUN for ver in $PHP_VERSIONS; do \
31+ ln -s /usr/bin/php${ver} /usr/bin/php-${ver}; \
32+ done
33+
34+ # Install Composer
535COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
36+
37+ # Set working directory
38+ WORKDIR /var/www
39+
40+ # Copy project files
641COPY . /var/www/
742
8- WORKDIR /var/www/
43+ # Default command
44+ CMD ["bash" ]
Original file line number Diff line number Diff line change 4242 run : sed -i 's@'$GITHUB_WORKSPACE/'@''@g' coverage.xml report.xml
4343
4444 - name : SonarCloud Scan
45- uses : SonarSource/sonarcloud-github -action@master
45+ uses : SonarSource/sonarqube-scan -action@v7
4646 env :
4747 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4848 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change 1+ [submodule ".docker "]
2+ path = .docker
3+ url = git@github.com:WsdlToPhp/DockerCommonImage.git
Original file line number Diff line number Diff line change 1515 'no_whitespace_in_blank_line ' => true ,
1616 'ternary_operator_spaces ' => true ,
1717 'cast_spaces ' => true ,
18- 'trailing_comma_in_multiline ' => true
18+ 'trailing_comma_in_multiline ' => true ,
19+ 'phpdoc_separation ' => false ,
20+ 'single_line_empty_body ' => false ,
1921 ))
2022 ->setFinder ($ finder );
Original file line number Diff line number Diff line change 1+ PHP_VERSION ?= php-7.4
2+ CONTAINER_NAME ?= package_base
3+ COMPOSER ?= /usr/bin/composer
4+ DOCKER_COMPOSE ?= docker compose
5+ DOCKER_EXEC_CONTAINER ?= docker exec -t $(CONTAINER_NAME )
6+
7+ .PHONY : bash build cs-fixer down install phpstan phpunit rector up update
8+
9+ bash :
10+ $(DOCKER_EXEC_CONTAINER ) bash
11+
12+ build :
13+ $(DOCKER_COMPOSE ) build
14+
15+ cs-fixer :
16+ $(DOCKER_EXEC_CONTAINER ) $(PHP_VERSION ) vendor/bin/php-cs-fixer fix --ansi --diff --verbose
17+
18+ down :
19+ $(DOCKER_COMPOSE ) down
20+
21+ install :
22+ $(DOCKER_EXEC_CONTAINER ) $(PHP_VERSION ) $(COMPOSER ) install
23+
24+ phpstan :
25+ $(DOCKER_EXEC_CONTAINER ) $(PHP_VERSION ) vendor/bin/phpstan analyze src --level=2
26+
27+ phpunit :
28+ $(DOCKER_EXEC_CONTAINER ) $(PHP_VERSION ) vendor/bin/phpunit
29+
30+ rector :
31+ $(DOCKER_EXEC_CONTAINER ) $(PHP_VERSION ) vendor/bin/rector process
32+
33+ up :
34+ $(DOCKER_COMPOSE ) up -d
35+
36+ update :
37+ $(DOCKER_EXEC_CONTAINER ) $(PHP_VERSION ) $(COMPOSER ) update
Original file line number Diff line number Diff line change 6969 "phpstan" : " vendor/bin/phpstan analyze src --level=5"
7070 },
7171 "require-dev" : {
72- "friendsofphp/php-cs-fixer" : " ~3.0" ,
73- "phpstan/phpstan" : " ^1.4" ,
74- "phpunit/phpunit" : " ^9"
72+ "friendsofphp/php-cs-fixer" : " ^3.0" ,
73+ "phpstan/phpstan" : " ^2" ,
74+ "phpunit/phpunit" : " ^9" ,
75+ "rector/rector" : " ^2"
7576 },
7677 "autoload" : {
7778 "psr-4" : {
Original file line number Diff line number Diff line change 1- version : ' 3.4'
2-
31services :
42 php :
53 build :
@@ -8,3 +6,4 @@ services:
86 volumes :
97 - .:/var/www:rw
108 container_name : package_base
9+ tty : true
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use Rector \CodeQuality \Rector \Class_ \InlineConstructorDefaultToPropertyRector ;
6+ use Rector \Config \RectorConfig ;
7+ use Rector \Set \ValueObject \LevelSetList ;
8+ use Rector \TypeDeclaration \Rector \ClassMethod \ReturnTypeFromStrictNativeCallRector ;
9+ use Rector \TypeDeclaration \Rector \ClassMethod \ReturnTypeFromStrictTypedPropertyRector ;
10+
11+ return static function (RectorConfig $ rectorConfig ): void {
12+ $ rectorConfig ->paths ([
13+ __DIR__ .'/src ' ,
14+ __DIR__ .'/tests ' ,
15+ ]);
16+ $ rectorConfig ->skip ([
17+ __DIR__ .'/tests/resources ' ,
18+ ]);
19+ // define sets of rules
20+ $ rectorConfig ->sets ([
21+ LevelSetList::UP_TO_PHP_74 ,
22+ ]);
23+
24+ // replace fully qualified class name by use statements
25+ $ rectorConfig ->importShortClasses (false );
26+ // keep native PHP class short name import
27+ $ rectorConfig ->importNames ();
28+
29+ // register a single rule
30+ $ rectorConfig ->rule (InlineConstructorDefaultToPropertyRector::class);
31+ $ rectorConfig ->rule (ReturnTypeFromStrictNativeCallRector::class);
32+ $ rectorConfig ->rule (ReturnTypeFromStrictTypedPropertyRector::class);
33+ };
Original file line number Diff line number Diff line change @@ -447,6 +447,6 @@ public function getOutputHeaders(): array
447447 */
448448 public function __toString (): string
449449 {
450- return get_called_class () ;
450+ return static ::class ;
451451 }
452452}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ public function jsonSerialize(): array
2727 */
2828 public static function __set_state (array $ array ): StructInterface
2929 {
30- $ reflection = new ReflectionClass (get_called_class () );
30+ $ reflection = new ReflectionClass (static ::class );
3131 $ object = $ reflection ->newInstance ();
3232 foreach ($ array as $ name => $ value ) {
3333 $ object ->setPropertyValue ($ name , $ value );
@@ -79,6 +79,6 @@ public function getPropertyValue(string $name)
7979 */
8080 public function __toString (): string
8181 {
82- return get_called_class () ;
82+ return static ::class ;
8383 }
8484}
You can’t perform that action at this time.
0 commit comments