Skip to content

Commit

Permalink
Merge pull request #5 from phalcon/v1.1.0
Browse files Browse the repository at this point in the history
V1.1.0
  • Loading branch information
sergeyklay authored Oct 8, 2018
2 parents 8b69803 + da68c5d commit 7fa6f6d
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 107 deletions.
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,21 @@ cache:
- vendor
- $HOME/.composer/cache

env:
global:
- PHALCON_VERSION=v3.3.2 #TODO change this version to 4.0 later


before_install:
- phpenv config-rm xdebug.ini || true
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com $GH_TOKEN; fi;

install:
- bash tests/_ci/install_phalcon.sh
- cd $TRAVIS_BUILD_DIR
- travis_retry composer install --prefer-dist --no-interaction

before_script:

script:
- vendor/bin/phpcs
- phpunit tests -v
- vendor/bin/phpunit tests -v
- vendor/bin/phpstan analyse -l max -c phpstan.neon src -v

notifications:
email:
on_success: never
on_failure: never
email: false
File renamed without changes.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"forum": "https://forum.phalconphp.com/"
},
"require": {
"php": ">=7.0",
"ext-phalcon": "~3.3"
"php": ">=7.0"
},
"require-dev": {
"phpunit/phpunit": "^6.5",
Expand Down
31 changes: 0 additions & 31 deletions src/Exception.php

This file was deleted.

38 changes: 13 additions & 25 deletions src/Parser.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
<?php

/*
+------------------------------------------------------------------------+
| Phalcon Cli option parser |
+------------------------------------------------------------------------+
| Copyright (c) 2011-present Phalcon Team (https://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to [email protected] so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Sergii Svyrydenko <[email protected]> |
+------------------------------------------------------------------------+
*/
/**
* This file is part of the Cop package.
*
* (c) Phalcon Team <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Phalcon\Cop;

Expand Down Expand Up @@ -44,16 +36,17 @@ class Parser
];

/**
* Parse CLI command
* Parse console input.
*
* @param array $argv
* @param array $argv
* @return array
*/
public function parse(array $argv = []): array
{
if (empty($argv)) {
$argv = $this->getArgvFromServer();
}

array_shift($argv);
$this->parsedCommands = [];

Expand Down Expand Up @@ -81,18 +74,13 @@ public function getBoolean(string $key, bool $default = false): bool
}

/**
* Get console command either from argument or from Server
* Gets array of arguments passed from the input.
*
* @return array
* @throws Exception
*/
protected function getArgvFromServer(): array
{
if (!empty($_SERVER['argv'])) {
return $_SERVER['argv'];
}

throw new Exception("Parameters haven't been defined yet");
return empty($_SERVER['argv']) ? [] : $_SERVER['argv'];
}

/**
Expand Down
40 changes: 0 additions & 40 deletions tests/_ci/install_phalcon.sh

This file was deleted.

0 comments on commit 7fa6f6d

Please sign in to comment.