@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | * @param null $app |
| 13 | 13 | * @return string |
| 14 | 14 | */ |
| 15 | - public function app($app=null) |
|
| 15 | + public function app($app = null) |
|
| 16 | 16 | {
|
| 17 | - $app=($app===null) ? $this->appDetector() : $app; |
|
| 17 | + $app = ($app===null) ? $this->appDetector() : $app; |
|
| 18 | 18 | return StaticPathModel::appPath().''.DIRECTORY_SEPARATOR.''.Str::slashToBackSlash($app); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @param null $app |
| 39 | 39 | * @return string |
| 40 | 40 | */ |
| 41 | - public function appCall($app=null) |
|
| 41 | + public function appCall($app = null) |
|
| 42 | 42 | {
|
| 43 | 43 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$controller; |
| 44 | 44 | } |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | * @param null $app |
| 57 | 57 | * @return string |
| 58 | 58 | */ |
| 59 | - public function appConfig($app=null) |
|
| 59 | + public function appConfig($app = null) |
|
| 60 | 60 | {
|
| 61 | - if(isset(core()->paths['config'])){
|
|
| 61 | + if (isset(core()->paths['config'])) {
|
|
| 62 | 62 | return core()->paths['config']; |
| 63 | 63 | } |
| 64 | 64 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$config; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @param null $app |
| 69 | 69 | * @return string |
| 70 | 70 | */ |
| 71 | - public function appHelpers($app=null) |
|
| 71 | + public function appHelpers($app = null) |
|
| 72 | 72 | {
|
| 73 | 73 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$helpers; |
| 74 | 74 | } |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | * @param null $app |
| 78 | 78 | * @return string |
| 79 | 79 | */ |
| 80 | - public function appTests($app=null) |
|
| 80 | + public function appTests($app = null) |
|
| 81 | 81 | {
|
| 82 | - $tests = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$test; |
|
| 82 | + $tests = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$test; |
|
| 83 | 83 | |
| 84 | 84 | return $tests; |
| 85 | 85 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @param null $app |
| 97 | 97 | * @return mixed |
| 98 | 98 | */ |
| 99 | - public function appFactory($app=null) |
|
| 99 | + public function appFactory($app = null) |
|
| 100 | 100 | {
|
| 101 | 101 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$factory; |
| 102 | 102 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | */ |
| 107 | 107 | public function appKernel() |
| 108 | 108 | {
|
| 109 | - $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel; |
|
| 109 | + $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel; |
|
| 110 | 110 | |
| 111 | 111 | return $kernel; |
| 112 | 112 | } |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function appProvider() |
| 118 | 118 | {
|
| 119 | - $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel.''.DIRECTORY_SEPARATOR.''.StaticPathList::$provider; |
|
| 119 | + $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel.''.DIRECTORY_SEPARATOR.''.StaticPathList::$provider; |
|
| 120 | 120 | |
| 121 | 121 | return $kernel; |
| 122 | 122 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * @param null $app |
| 142 | 142 | * @return mixed |
| 143 | 143 | */ |
| 144 | - public function appLogger($app=null) |
|
| 144 | + public function appLogger($app = null) |
|
| 145 | 145 | {
|
| 146 | 146 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceLogManager'; |
| 147 | 147 | } |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @param null $app |
| 151 | 151 | * @return mixed |
| 152 | 152 | */ |
| 153 | - public function appMiddleware($app=null) |
|
| 153 | + public function appMiddleware($app = null) |
|
| 154 | 154 | {
|
| 155 | 155 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$middleware; |
| 156 | 156 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | * @param null $app |
| 160 | 160 | * @return mixed |
| 161 | 161 | */ |
| 162 | - public function appMigration($app=null) |
|
| 162 | + public function appMigration($app = null) |
|
| 163 | 163 | {
|
| 164 | 164 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$migration; |
| 165 | 165 | } |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | * @param null $app |
| 169 | 169 | * @return mixed |
| 170 | 170 | */ |
| 171 | - public function appModel($app=null) |
|
| 171 | + public function appModel($app = null) |
|
| 172 | 172 | {
|
| 173 | 173 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$model; |
| 174 | 174 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | * @param null $app |
| 178 | 178 | * @return mixed |
| 179 | 179 | */ |
| 180 | - public function appException($app=null) |
|
| 180 | + public function appException($app = null) |
|
| 181 | 181 | {
|
| 182 | 182 | return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$exception; |
| 183 | 183 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | * @param null $app |
| 187 | 187 | * @return mixed |
| 188 | 188 | */ |
| 189 | - public function appOptionalEvents($app=null) |
|
| 189 | + public function appOptionalEvents($app = null) |
|
| 190 | 190 | {
|
| 191 | 191 | return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$events; |
| 192 | 192 | } |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @param null $app |
| 196 | 196 | * @return mixed |
| 197 | 197 | */ |
| 198 | - public function appOptionalJob($app=null) |
|
| 198 | + public function appOptionalJob($app = null) |
|
| 199 | 199 | {
|
| 200 | 200 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$job; |
| 201 | 201 | } |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * @param null $app |
| 205 | 205 | * @return mixed |
| 206 | 206 | */ |
| 207 | - public function appOptionalListeners($app=null) |
|
| 207 | + public function appOptionalListeners($app = null) |
|
| 208 | 208 | {
|
| 209 | 209 | return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$listeners; |
| 210 | 210 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | * @param null $app |
| 214 | 214 | * @return mixed |
| 215 | 215 | */ |
| 216 | - public function appOptionalSubscribers($app=null) |
|
| 216 | + public function appOptionalSubscribers($app = null) |
|
| 217 | 217 | {
|
| 218 | 218 | return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$listeners.''.DIRECTORY_SEPARATOR.''.StaticPathList::$subscribers; |
| 219 | 219 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function appRepository() |
| 233 | 233 | {
|
| 234 | - $repository = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$repository; |
|
| 234 | + $repository = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$repository; |
|
| 235 | 235 | |
| 236 | 236 | return $repository; |
| 237 | 237 | } |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | * @param null $app |
| 249 | 249 | * @return mixed |
| 250 | 250 | */ |
| 251 | - public function appOptionalSource($app=null) |
|
| 251 | + public function appOptionalSource($app = null) |
|
| 252 | 252 | {
|
| 253 | 253 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$sourcePath; |
| 254 | 254 | } |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | * @param null $app |
| 258 | 258 | * @return mixed |
| 259 | 259 | */ |
| 260 | - public function appOptionalWebservice($app=null) |
|
| 260 | + public function appOptionalWebservice($app = null) |
|
| 261 | 261 | {
|
| 262 | 262 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$webservice; |
| 263 | 263 | } |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | * @param null $app |
| 275 | 275 | * @return mixed |
| 276 | 276 | */ |
| 277 | - public function appServiceAnnotations($app=null) |
|
| 277 | + public function appServiceAnnotations($app = null) |
|
| 278 | 278 | {
|
| 279 | 279 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$serviceAnnotations; |
| 280 | 280 | } |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | * @param null $app |
| 284 | 284 | * @return mixed |
| 285 | 285 | */ |
| 286 | - public function appServiceContainer($app=null) |
|
| 286 | + public function appServiceContainer($app = null) |
|
| 287 | 287 | {
|
| 288 | 288 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceContainerController'; |
| 289 | 289 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | * @param null $app |
| 293 | 293 | * @return mixed |
| 294 | 294 | */ |
| 295 | - public function appServiceEventDispatcher($app=null) |
|
| 295 | + public function appServiceEventDispatcher($app = null) |
|
| 296 | 296 | {
|
| 297 | 297 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceEventDispatcherManager'; |
| 298 | 298 | } |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | * @param null $app |
| 302 | 302 | * @return mixed |
| 303 | 303 | */ |
| 304 | - public function appServiceMiddleware($app=null) |
|
| 304 | + public function appServiceMiddleware($app = null) |
|
| 305 | 305 | {
|
| 306 | 306 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$serviceMiddleware; |
| 307 | 307 | } |
@@ -328,9 +328,9 @@ discard block |
||
| 328 | 328 | * @param null $app |
| 329 | 329 | * @return mixed |
| 330 | 330 | */ |
| 331 | - public function appVersion($app=null) |
|
| 331 | + public function appVersion($app = null) |
|
| 332 | 332 | {
|
| 333 | - if(defined('app')){
|
|
| 333 | + if (defined('app')) {
|
|
| 334 | 334 | |
| 335 | 335 | $prefixGroup = Str::slashToBackSlash(StaticPathList::$projectPrefixGroup); |
| 336 | 336 | |
@@ -374,19 +374,19 @@ discard block |
||
| 374 | 374 | * @param bool $bool |
| 375 | 375 | * @return mixed |
| 376 | 376 | */ |
| 377 | - public function controller($controller=null,$bool=false) |
|
| 377 | + public function controller($controller = null, $bool = false) |
|
| 378 | 378 | {
|
| 379 | 379 | $namespaceController = ($controller===null) ? app()->namespace()->controller() |
| 380 | - : app()->namespace()->controller($controller,true); |
|
| 380 | + : app()->namespace()->controller($controller, true); |
|
| 381 | 381 | |
| 382 | - if($bool){
|
|
| 383 | - $namespaceControllerExplode = explode("\\",$namespaceController);
|
|
| 382 | + if ($bool) {
|
|
| 383 | + $namespaceControllerExplode = explode("\\", $namespaceController);
|
|
| 384 | 384 | array_pop($namespaceControllerExplode); |
| 385 | 385 | |
| 386 | - $namespaceController = implode("\\",$namespaceControllerExplode);
|
|
| 386 | + $namespaceController = implode("\\", $namespaceControllerExplode);
|
|
| 387 | 387 | } |
| 388 | 388 | |
| 389 | - return Utils::getPathFromNamespace($namespaceController,false); |
|
| 389 | + return Utils::getPathFromNamespace($namespaceController, false); |
|
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | /** |
@@ -410,9 +410,9 @@ discard block |
||
| 410 | 410 | * @param $arg |
| 411 | 411 | * @return mixed |
| 412 | 412 | */ |
| 413 | - public function __call($name,$arg) |
|
| 413 | + public function __call($name, $arg) |
|
| 414 | 414 | {
|
| 415 | - $appCall='app'.ucfirst($name); |
|
| 415 | + $appCall = 'app'.ucfirst($name); |
|
| 416 | 416 | return $this->{$appCall}();
|
| 417 | 417 | } |
| 418 | 418 | |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | {
|
| 40 | 40 | $xml = $this->getXml(); |
| 41 | 41 | |
| 42 | - return json_decode(json_encode((array) $xml), true); |
|
| 42 | + return json_decode(json_encode((array)$xml), true); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | /** |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * @param array $data |
| 49 | 49 | * @return string |
| 50 | 50 | */ |
| 51 | - public function toXml($data=array()) |
|
| 51 | + public function toXml($data = array()) |
|
| 52 | 52 | {
|
| 53 | 53 | return ArrayToXml::convert($data); |
| 54 | 54 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | * PhpUnitManager constructor. |
| 14 | 14 | * @param array $data |
| 15 | 15 | */ |
| 16 | - public function __construct($data=array()) |
|
| 16 | + public function __construct($data = array()) |
|
| 17 | 17 | {
|
| 18 | 18 | $this->data = $data; |
| 19 | 19 | } |
@@ -26,21 +26,21 @@ discard block |
||
| 26 | 26 | * @param null|string $value |
| 27 | 27 | * @return mixed |
| 28 | 28 | */ |
| 29 | - public function add($attribute=null,$key=null,$value=null) |
|
| 29 | + public function add($attribute = null, $key = null, $value = null) |
|
| 30 | 30 | {
|
| 31 | 31 | $list = []; |
| 32 | 32 | |
| 33 | 33 | //all add method parameters must come full. |
| 34 | - if(!is_null($attribute) && !is_null($key) && !is_null($value)){
|
|
| 34 | + if (!is_null($attribute) && !is_null($key) && !is_null($value)) {
|
|
| 35 | 35 | |
| 36 | 36 | // we do 0 key control for the testsuite data. |
| 37 | 37 | // this phpunit has a multiple test suite data if 0 key is present. |
| 38 | - if(isset($this->data['testsuites']['testsuite'][0])){
|
|
| 39 | - foreach ($this->data['testsuites']['testsuite'] as $key=>$item){
|
|
| 38 | + if (isset($this->data['testsuites']['testsuite'][0])) {
|
|
| 39 | + foreach ($this->data['testsuites']['testsuite'] as $key=>$item) {
|
|
| 40 | 40 | $list[$key] = $item; |
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | - else{
|
|
| 43 | + else {
|
|
| 44 | 44 | //only for a single test suite data |
| 45 | 45 | $list[] = $this->data['testsuites']['testsuite']; |
| 46 | 46 | } |
@@ -39,8 +39,7 @@ |
||
| 39 | 39 | foreach ($this->data['testsuites']['testsuite'] as $key=>$item){
|
| 40 | 40 | $list[$key] = $item; |
| 41 | 41 | } |
| 42 | - } |
|
| 43 | - else{
|
|
| 42 | + } else{
|
|
| 44 | 43 | //only for a single test suite data |
| 45 | 44 | $list[] = $this->data['testsuites']['testsuite']; |
| 46 | 45 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * @var array |
| 27 | 27 | */ |
| 28 | - protected $stubList=array(); |
|
| 28 | + protected $stubList = array(); |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * FileProcess constructor. |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | * @param $data |
| 42 | 42 | * @return bool |
| 43 | 43 | */ |
| 44 | - public function dumpFile($file,$data) |
|
| 44 | + public function dumpFile($file, $data) |
|
| 45 | 45 | {
|
| 46 | 46 | try {
|
| 47 | - $this->fs->dumpFile($file,$data); |
|
| 47 | + $this->fs->dumpFile($file, $data); |
|
| 48 | 48 | return true; |
| 49 | 49 | } catch (IOExceptionInterface $exception) {
|
| 50 | 50 | return false; |
@@ -56,21 +56,21 @@ discard block |
||
| 56 | 56 | * @param bool $status |
| 57 | 57 | * @return mixed |
| 58 | 58 | */ |
| 59 | - public function makeDirectory($data,$status=false) |
|
| 59 | + public function makeDirectory($data, $status = false) |
|
| 60 | 60 | {
|
| 61 | - if($data->type=="project" && file_exists($data->project)){
|
|
| 61 | + if ($data->type=="project" && file_exists($data->project)) {
|
|
| 62 | 62 | throw new \LogicException('This Project Is Already Available');
|
| 63 | 63 | } |
| 64 | - if(false===$status){
|
|
| 64 | + if (false===$status) {
|
|
| 65 | 65 | |
| 66 | - if($data->type!=="project" && !file_exists($data->project)){
|
|
| 66 | + if ($data->type!=="project" && !file_exists($data->project)) {
|
|
| 67 | 67 | throw new \LogicException('Project No');
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | - foreach ($data->directory as $directory){
|
|
| 70 | + foreach ($data->directory as $directory) {
|
|
| 71 | 71 | try {
|
| 72 | - $this->fs->mkdir($directory,'0777'); |
|
| 73 | - chmod($directory,0777); |
|
| 72 | + $this->fs->mkdir($directory, '0777'); |
|
| 73 | + chmod($directory, 0777); |
|
| 74 | 74 | } catch (IOExceptionInterface $e) {
|
| 75 | 75 | return "An error occurred while creating your directory at ".$e->getPath(); |
| 76 | 76 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | public function setDirectory($directory) |
| 85 | 85 | {
|
| 86 | 86 | try {
|
| 87 | - $this->fs->mkdir($directory,'07777'); |
|
| 87 | + $this->fs->mkdir($directory, '07777'); |
|
| 88 | 88 | } catch (IOExceptionInterface $e) {
|
| 89 | 89 | return "An error occurred while creating your directory at ".$e->getPath(); |
| 90 | 90 | } |
@@ -102,25 +102,25 @@ discard block |
||
| 102 | 102 | * @param $data |
| 103 | 103 | * @param array $complex |
| 104 | 104 | */ |
| 105 | - public function touch($data,$complex=array()) |
|
| 105 | + public function touch($data, $complex = array()) |
|
| 106 | 106 | {
|
| 107 | - $this->data=$data; |
|
| 107 | + $this->data = $data; |
|
| 108 | 108 | |
| 109 | - if(isset($complex['stub']) && isset($this->data->argument['stub'])){
|
|
| 109 | + if (isset($complex['stub']) && isset($this->data->argument['stub'])) {
|
|
| 110 | 110 | |
| 111 | 111 | $this->stubManager($complex); |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - $execArray=(count($this->stubList)) ? $this->stubList : $this->data->touch; |
|
| 114 | + $execArray = (count($this->stubList)) ? $this->stubList : $this->data->touch; |
|
| 115 | 115 | |
| 116 | - foreach ($execArray as $execution=>$touch){
|
|
| 116 | + foreach ($execArray as $execution=>$touch) {
|
|
| 117 | 117 | |
| 118 | - if(!file_exists($touch) && $touch!==null){
|
|
| 118 | + if (!file_exists($touch) && $touch!==null) {
|
|
| 119 | 119 | touch($touch); |
| 120 | 120 | |
| 121 | - $executionPath=$this->stubPath.'/'.$execution.'.stub'; |
|
| 122 | - if(file_exists($executionPath)){
|
|
| 123 | - $this->fopenprocess($executionPath,$touch,$data); |
|
| 121 | + $executionPath = $this->stubPath.'/'.$execution.'.stub'; |
|
| 122 | + if (file_exists($executionPath)) {
|
|
| 123 | + $this->fopenprocess($executionPath, $touch, $data); |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -129,37 +129,37 @@ discard block |
||
| 129 | 129 | /** |
| 130 | 130 | * @param array $complex |
| 131 | 131 | */ |
| 132 | - private function stubManager($complex=array()) |
|
| 132 | + private function stubManager($complex = array()) |
|
| 133 | 133 | {
|
| 134 | - $stubStructure = explode("_",$complex['stub']);
|
|
| 134 | + $stubStructure = explode("_", $complex['stub']);
|
|
| 135 | 135 | $stubStructure[] = $this->data->argument['stub']; |
| 136 | 136 | |
| 137 | - $stubberDirectoryList=path()->stubs(); |
|
| 137 | + $stubberDirectoryList = path()->stubs(); |
|
| 138 | 138 | |
| 139 | - foreach ($stubStructure as $stubberDirectory){
|
|
| 139 | + foreach ($stubStructure as $stubberDirectory) {
|
|
| 140 | 140 | |
| 141 | - $stubberDirectoryList=$stubberDirectoryList.'/'.$stubberDirectory; |
|
| 141 | + $stubberDirectoryList = $stubberDirectoryList.'/'.$stubberDirectory; |
|
| 142 | 142 | |
| 143 | 143 | $this->setDirectory($stubberDirectoryList); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - foreach ($this->data->touch as $execution=>$executionFile){
|
|
| 146 | + foreach ($this->data->touch as $execution=>$executionFile) {
|
|
| 147 | 147 | |
| 148 | - $executionArray=explode("/",$execution);
|
|
| 148 | + $executionArray = explode("/", $execution);
|
|
| 149 | 149 | |
| 150 | 150 | $executionStub = end($executionArray).''; |
| 151 | 151 | $this->stubList[$executionStub] = $executionFile; |
| 152 | 152 | $stubberFile = $stubberDirectoryList.'/'.$executionStub.'.stub'; |
| 153 | 153 | |
| 154 | - $originalPath=$this->stubPath.'/'.$execution.'.stub'; |
|
| 154 | + $originalPath = $this->stubPath.'/'.$execution.'.stub'; |
|
| 155 | 155 | |
| 156 | - if(!file_exists($stubberFile)){
|
|
| 156 | + if (!file_exists($stubberFile)) {
|
|
| 157 | 157 | |
| 158 | - $this->fs->copy($originalPath,$stubberFile); |
|
| 158 | + $this->fs->copy($originalPath, $stubberFile); |
|
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - $this->stubPath=$stubberDirectoryList; |
|
| 162 | + $this->stubPath = $stubberDirectoryList; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
@@ -169,15 +169,15 @@ discard block |
||
| 169 | 169 | * @param $param |
| 170 | 170 | * @return bool |
| 171 | 171 | */ |
| 172 | - public function fopenprocess($executionPath,$path,$param) |
|
| 172 | + public function fopenprocess($executionPath, $path, $param) |
|
| 173 | 173 | {
|
| 174 | 174 | $dt = fopen($executionPath, "r"); |
| 175 | 175 | $content = fread($dt, filesize($executionPath)); |
| 176 | 176 | fclose($dt); |
| 177 | 177 | |
| 178 | - foreach ($param->argument as $key=>$value){
|
|
| 178 | + foreach ($param->argument as $key=>$value) {
|
|
| 179 | 179 | |
| 180 | - $content=str_replace("__".$key."__",$value,$content);
|
|
| 180 | + $content = str_replace("__".$key."__", $value, $content);
|
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | $dt = fopen($path, "w"); |
@@ -193,14 +193,14 @@ discard block |
||
| 193 | 193 | * @param $param |
| 194 | 194 | * @return bool |
| 195 | 195 | */ |
| 196 | - public function stubCopy($executionPath,$path,$param) |
|
| 196 | + public function stubCopy($executionPath, $path, $param) |
|
| 197 | 197 | {
|
| 198 | 198 | $dt = fopen($executionPath, "r"); |
| 199 | 199 | $content = fread($dt, filesize($executionPath)); |
| 200 | 200 | fclose($dt); |
| 201 | 201 | |
| 202 | - foreach ($param->argument as $key=>$value){
|
|
| 203 | - $content=str_replace("__".$key."__",$value,$content);
|
|
| 202 | + foreach ($param->argument as $key=>$value) {
|
|
| 203 | + $content = str_replace("__".$key."__", $value, $content);
|
|
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | $dt = fopen($path, "w"); |
@@ -214,9 +214,9 @@ discard block |
||
| 214 | 214 | * @param null $file |
| 215 | 215 | * @return mixed|null |
| 216 | 216 | */ |
| 217 | - public function callFile($file=null) |
|
| 217 | + public function callFile($file = null) |
|
| 218 | 218 | {
|
| 219 | - if(file_exists($file)){
|
|
| 219 | + if (file_exists($file)) {
|
|
| 220 | 220 | return require_once($file); |
| 221 | 221 | } |
| 222 | 222 | return null; |
@@ -228,9 +228,9 @@ discard block |
||
| 228 | 228 | * @param null|string $file |
| 229 | 229 | * @param null|string $data |
| 230 | 230 | */ |
| 231 | - public function writeFile($file=null,$data=null) |
|
| 231 | + public function writeFile($file = null, $data = null) |
|
| 232 | 232 | {
|
| 233 | - if(!is_null($file) && !is_null($data)){
|
|
| 233 | + if (!is_null($file) && !is_null($data)) {
|
|
| 234 | 234 | |
| 235 | 235 | $dt = fopen($file, "r"); |
| 236 | 236 | $content = fread($dt, filesize($file)); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function create() |
| 36 | 36 | {
|
| 37 | 37 | |
| 38 | - if(!file_exists(app()->path()->tests())){
|
|
| 38 | + if (!file_exists(app()->path()->tests())) {
|
|
| 39 | 39 | $this->directory['test'] = app()->path()->tests(); |
| 40 | 40 | $this->file->makeDirectory($this); |
| 41 | 41 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $this->argument['testNamespace'] = ucfirst($this->argument['test']).'Test'; |
| 45 | 45 | $this->argument['projectName'] = strtolower($this->projectName()); |
| 46 | 46 | |
| 47 | - $this->touch['test/test']= app()->path()->tests().'/'.$this->argument['testNamespace'].'.php'; |
|
| 47 | + $this->touch['test/test'] = app()->path()->tests().'/'.$this->argument['testNamespace'].'.php'; |
|
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | $this->file->touch($this); |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $array = $xml->toArray(); |
| 65 | 65 | |
| 66 | - $new = (new PhpUnitManager($array))->add(strtolower($this->projectName()),'directory', |
|
| 67 | - str_replace(root.''.DIRECTORY_SEPARATOR,"",app()->path()->tests())); |
|
| 66 | + $new = (new PhpUnitManager($array))->add(strtolower($this->projectName()), 'directory', |
|
| 67 | + str_replace(root.''.DIRECTORY_SEPARATOR, "", app()->path()->tests())); |
|
| 68 | 68 | |
| 69 | 69 | $newDataXml = $xml->toXml($new); |
| 70 | 70 | |
| 71 | - app()->get('fileSystem')->writeFile($phpunit,$newDataXml);
|
|
| 71 | + app()->get('fileSystem')->writeFile($phpunit, $newDataXml);
|
|
| 72 | 72 | |
| 73 | 73 | echo $this->classical(' > phpunit.xml file has been updated');
|
| 74 | 74 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | */ |
| 79 | 79 | public function run() |
| 80 | 80 | {
|
| 81 | - $process = new Process(['vendor'.DIRECTORY_SEPARATOR.'bin'.DIRECTORY_SEPARATOR.'phpunit','--group',strtolower($this->projectName())]); |
|
| 81 | + $process = new Process(['vendor'.DIRECTORY_SEPARATOR.'bin'.DIRECTORY_SEPARATOR.'phpunit', '--group', strtolower($this->projectName())]); |
|
| 82 | 82 | $process->setTty(true); |
| 83 | 83 | |
| 84 | 84 | try {
|