diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..8cfa155 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,20 @@ +# Declare a pipeline +pipeline: + # Declare pipeline step + composer-install: + # Use image for step + image: fpfis/php71-build + # Run commands from this image + commands: + - composer install --ansi + + # Declare another step + lint-code: + image: fpfis/php71-build + commands: + - php -l index.php + + run-code: + image: fpfis/php71-build + commands: + - php index.php diff --git a/composer.json b/composer.json index e7ac977..00e7dd8 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { "require": { - "symfony/yaml" : "*", + "symfony/yaml" : "*" } } diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..c720c33 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,18 @@ +version: '2' +services: + + # Define a PHP webserver + php-webserver: + # Use a PHP image with apache + image: fpfis/php71-dev + # Define settings + environment: + - XDEBUG=true + - DOCUMENT_ROOT=/app/build + # Mount a local volume in the container + volumes: + - ./:/app/build + # Share the container port with the host + ports: + - 8080:8080 + diff --git a/index.php b/index.php index 03efc33..436c3fa 100644 --- a/index.php +++ b/index.php @@ -5,9 +5,13 @@ use Symfony\Component\Yaml\Yaml; -$array = array( +$array = [ + 'foo' => 'bar', + 'bar' => [ 'foo' => 'bar', - 'bar' => array('foo' => 'bar', 'bar' => 'baz' => 'test'), -); + 'bar' => 'baz', + 'test' + ], +]; echo Yaml::dump($array);