forked from loafle/openapi-generator-original
[Slim4] Add PHP syntax checker (#4831)
This commit is contained in:
parent
fb0479a213
commit
c6ec794293
1
pom.xml
1
pom.xml
@ -1048,6 +1048,7 @@
|
||||
<module>samples/client/petstore/php/OpenAPIClient-php</module>
|
||||
<module>samples/openapi3/client/petstore/php/OpenAPIClient-php</module>
|
||||
<module>samples/server/petstore/php-slim</module>
|
||||
<module>samples/server/petstore/php-slim4</module>
|
||||
<module>samples/client/petstore/javascript</module>
|
||||
<module>samples/client/petstore/javascript-es6</module>
|
||||
<module>samples/openapi3/client/petstore/javascript-es6</module>
|
||||
|
11
samples/server/petstore/php-slim4/php_syntax_checker.bash
Executable file
11
samples/server/petstore/php-slim4/php_syntax_checker.bash
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# a simple script to perform a syntax check on php files using "php -l"
|
||||
|
||||
for i in $( find . -name "*.php" ); do
|
||||
result=`php -l $i | grep "No syntax errors detected"`
|
||||
exit_status=$?
|
||||
if [ $exit_status -eq 1 ]; then
|
||||
echo "Syntax errors with $i"
|
||||
exit 1;
|
||||
fi
|
||||
done
|
43
samples/server/petstore/php-slim4/pom.xml
Normal file
43
samples/server/petstore/php-slim4/pom.xml
Normal file
@ -0,0 +1,43 @@
|
||||
<project>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.opoenapitools</groupId>
|
||||
<artifactId>Slim4PetstoreServerTests</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<name>Slim4 Petstore Server</name>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>${project.build.directory}</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
<version>1.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>syntax-check</id>
|
||||
<phase>integration-test</phase>
|
||||
<goals>
|
||||
<goal>exec</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<executable>./php_syntax_checker.bash</executable>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
Loading…
x
Reference in New Issue
Block a user