@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | function setBorder($border) |
| 267 | 267 | {
|
| 268 | - if ($border === CONSOLE_TABLE_BORDER_ASCII) {
|
|
| 268 | + if ($border===CONSOLE_TABLE_BORDER_ASCII) {
|
|
| 269 | 269 | $intersection = '+'; |
| 270 | 270 | $horizontal = '-'; |
| 271 | 271 | $vertical = '|'; |
| 272 | 272 | } else if (is_string($border)) {
|
| 273 | 273 | $intersection = $horizontal = $vertical = $border; |
| 274 | - } else if ($border == '') {
|
|
| 274 | + } else if ($border=='') {
|
|
| 275 | 275 | $intersection = $horizontal = $vertical = ''; |
| 276 | 276 | } else {
|
| 277 | 277 | extract($border); |
@@ -398,7 +398,7 @@ discard block |
||
| 398 | 398 | $this->_data[$row_id++][$col_id] = $col_cell; |
| 399 | 399 | } |
| 400 | 400 | $this->_updateRowsCols(); |
| 401 | - $this->_max_cols = max($this->_max_cols, $col_id + 1); |
|
| 401 | + $this->_max_cols = max($this->_max_cols, $col_id+1); |
|
| 402 | 402 | } |
| 403 | 403 | /** |
| 404 | 404 | * Adds data to the table. |
@@ -412,7 +412,7 @@ discard block |
||
| 412 | 412 | function addData($data, $col_id = 0, $row_id = 0) |
| 413 | 413 | {
|
| 414 | 414 | foreach ($data as $row) {
|
| 415 | - if ($row === CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 415 | + if ($row===CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 416 | 416 | $this->_data[$row_id] = CONSOLE_TABLE_HORIZONTAL_RULE; |
| 417 | 417 | $row_id++; |
| 418 | 418 | continue; |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | $column = $filter[0]; |
| 484 | 484 | $callback = $filter[1]; |
| 485 | 485 | foreach ($this->_data as $row_id => $row_data) {
|
| 486 | - if ($row_data !== CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 486 | + if ($row_data!==CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 487 | 487 | $this->_data[$row_id][$column] = |
| 488 | 488 | call_user_func($callback, $row_data[$column]); |
| 489 | 489 | } |
@@ -500,25 +500,25 @@ discard block |
||
| 500 | 500 | if (!empty($this->_headers)) {
|
| 501 | 501 | $this->_calculateRowHeight(-1, $this->_headers[0]); |
| 502 | 502 | } |
| 503 | - for ($i = 0; $i < $this->_max_rows; $i++) {
|
|
| 504 | - for ($j = 0; $j < $this->_max_cols; $j++) {
|
|
| 503 | + for ($i = 0; $i<$this->_max_rows; $i++) {
|
|
| 504 | + for ($j = 0; $j<$this->_max_cols; $j++) {
|
|
| 505 | 505 | if (!isset($this->_data[$i][$j]) && |
| 506 | 506 | (!isset($this->_data[$i]) || |
| 507 | - $this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE)) {
|
|
| 507 | + $this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE)) {
|
|
| 508 | 508 | $this->_data[$i][$j] = ''; |
| 509 | 509 | } |
| 510 | 510 | } |
| 511 | 511 | $this->_calculateRowHeight($i, $this->_data[$i]); |
| 512 | - if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 512 | + if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 513 | 513 | ksort($this->_data[$i]); |
| 514 | 514 | } |
| 515 | 515 | } |
| 516 | 516 | $this->_splitMultilineRows(); |
| 517 | 517 | // Update cell lengths. |
| 518 | - for ($i = 0; $i < count($this->_headers); $i++) {
|
|
| 518 | + for ($i = 0; $i<count($this->_headers); $i++) {
|
|
| 519 | 519 | $this->_calculateCellLengths($this->_headers[$i]); |
| 520 | 520 | } |
| 521 | - for ($i = 0; $i < $this->_max_rows; $i++) {
|
|
| 521 | + for ($i = 0; $i<$this->_max_rows; $i++) {
|
|
| 522 | 522 | $this->_calculateCellLengths($this->_data[$i]); |
| 523 | 523 | } |
| 524 | 524 | ksort($this->_data); |
@@ -534,24 +534,24 @@ discard block |
||
| 534 | 534 | $sections = array(&$this->_headers, &$this->_data); |
| 535 | 535 | $max_rows = array(count($this->_headers), $this->_max_rows); |
| 536 | 536 | $row_height_offset = array(-1, 0); |
| 537 | - for ($s = 0; $s <= 1; $s++) {
|
|
| 537 | + for ($s = 0; $s<=1; $s++) {
|
|
| 538 | 538 | $inserted = 0; |
| 539 | 539 | $new_data = $sections[$s]; |
| 540 | - for ($i = 0; $i < $max_rows[$s]; $i++) {
|
|
| 540 | + for ($i = 0; $i<$max_rows[$s]; $i++) {
|
|
| 541 | 541 | // Process only rows that have many lines. |
| 542 | - $height = $this->_row_heights[$i + $row_height_offset[$s]]; |
|
| 543 | - if ($height > 1) {
|
|
| 542 | + $height = $this->_row_heights[$i+$row_height_offset[$s]]; |
|
| 543 | + if ($height>1) {
|
|
| 544 | 544 | // Split column data into one-liners. |
| 545 | 545 | $split = array(); |
| 546 | - for ($j = 0; $j < $this->_max_cols; $j++) {
|
|
| 546 | + for ($j = 0; $j<$this->_max_cols; $j++) {
|
|
| 547 | 547 | $split[$j] = preg_split('/\r?\n|\r/',
|
| 548 | 548 | $sections[$s][$i][$j]); |
| 549 | 549 | } |
| 550 | 550 | $new_rows = array(); |
| 551 | 551 | // Construct new 'virtual' rows - insert empty strings for |
| 552 | 552 | // columns that have less lines that the highest one. |
| 553 | - for ($i2 = 0; $i2 < $height; $i2++) {
|
|
| 554 | - for ($j = 0; $j < $this->_max_cols; $j++) {
|
|
| 553 | + for ($i2 = 0; $i2<$height; $i2++) {
|
|
| 554 | + for ($j = 0; $j<$this->_max_cols; $j++) {
|
|
| 555 | 555 | $new_rows[$i2][$j] = !isset($split[$j][$i2]) |
| 556 | 556 | ? '' |
| 557 | 557 | : $split[$j][$i2]; |
@@ -560,12 +560,12 @@ discard block |
||
| 560 | 560 | // Replace current row with smaller rows. $inserted is |
| 561 | 561 | // used to take account of bigger array because of already |
| 562 | 562 | // inserted rows. |
| 563 | - array_splice($new_data, $i + $inserted, 1, $new_rows); |
|
| 564 | - $inserted += count($new_rows) - 1; |
|
| 563 | + array_splice($new_data, $i+$inserted, 1, $new_rows); |
|
| 564 | + $inserted += count($new_rows)-1; |
|
| 565 | 565 | } |
| 566 | 566 | } |
| 567 | 567 | // Has the data been modified? |
| 568 | - if ($inserted > 0) {
|
|
| 568 | + if ($inserted>0) {
|
|
| 569 | 569 | $sections[$s] = $new_data; |
| 570 | 570 | $this->_updateRowsCols(); |
| 571 | 571 | } |
@@ -584,10 +584,10 @@ discard block |
||
| 584 | 584 | $vertical = $this->_border['vertical']; |
| 585 | 585 | $separator = $this->_getSeparator(); |
| 586 | 586 | $return = array(); |
| 587 | - for ($i = 0; $i < count($this->_data); $i++) {
|
|
| 588 | - for ($j = 0; $j < count($this->_data[$i]); $j++) {
|
|
| 589 | - if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE && |
|
| 590 | - $this->_strlen($this->_data[$i][$j]) < |
|
| 587 | + for ($i = 0; $i<count($this->_data); $i++) {
|
|
| 588 | + for ($j = 0; $j<count($this->_data[$i]); $j++) {
|
|
| 589 | + if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE && |
|
| 590 | + $this->_strlen($this->_data[$i][$j])< |
|
| 591 | 591 | $this->_cell_lengths[$j]) {
|
| 592 | 592 | $this->_data[$i][$j] = $this->_strpad($this->_data[$i][$j], |
| 593 | 593 | $this->_cell_lengths[$j], |
@@ -595,17 +595,17 @@ discard block |
||
| 595 | 595 | $this->_col_align[$j]); |
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | - if ($this->_data[$i] !== CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 598 | + if ($this->_data[$i]!==CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 599 | 599 | $row_begin = $this->_borderVisibility['left'] |
| 600 | - ? $vertical . str_repeat(' ', $this->_padding)
|
|
| 600 | + ? $vertical.str_repeat(' ', $this->_padding)
|
|
| 601 | 601 | : ''; |
| 602 | 602 | $row_end = $this->_borderVisibility['right'] |
| 603 | - ? str_repeat(' ', $this->_padding) . $vertical
|
|
| 603 | + ? str_repeat(' ', $this->_padding).$vertical
|
|
| 604 | 604 | : ''; |
| 605 | - $implode_char = str_repeat(' ', $this->_padding) . $vertical
|
|
| 605 | + $implode_char = str_repeat(' ', $this->_padding).$vertical
|
|
| 606 | 606 | . str_repeat(' ', $this->_padding);
|
| 607 | 607 | $return[] = $row_begin |
| 608 | - . implode($implode_char, $this->_data[$i]) . $row_end; |
|
| 608 | + . implode($implode_char, $this->_data[$i]).$row_end; |
|
| 609 | 609 | } elseif (!empty($separator)) {
|
| 610 | 610 | $return[] = $separator; |
| 611 | 611 | } |
@@ -613,15 +613,15 @@ discard block |
||
| 613 | 613 | $return = implode(PHP_EOL, $return); |
| 614 | 614 | if (!empty($separator)) {
|
| 615 | 615 | if ($this->_borderVisibility['inner']) {
|
| 616 | - $return = $separator . PHP_EOL . $return; |
|
| 616 | + $return = $separator.PHP_EOL.$return; |
|
| 617 | 617 | } |
| 618 | 618 | if ($this->_borderVisibility['bottom']) {
|
| 619 | - $return .= PHP_EOL . $separator; |
|
| 619 | + $return .= PHP_EOL.$separator; |
|
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | $return .= PHP_EOL; |
| 623 | 623 | if (!empty($this->_headers)) {
|
| 624 | - $return = $this->_getHeaderLine() . PHP_EOL . $return; |
|
| 624 | + $return = $this->_getHeaderLine().PHP_EOL.$return; |
|
| 625 | 625 | } |
| 626 | 626 | return $return; |
| 627 | 627 | } |
@@ -643,14 +643,14 @@ discard block |
||
| 643 | 643 | $return[] = str_repeat($horizontal, $cl); |
| 644 | 644 | } |
| 645 | 645 | $row_begin = $this->_borderVisibility['left'] |
| 646 | - ? $intersection . str_repeat($horizontal, $this->_padding) |
|
| 646 | + ? $intersection.str_repeat($horizontal, $this->_padding) |
|
| 647 | 647 | : ''; |
| 648 | 648 | $row_end = $this->_borderVisibility['right'] |
| 649 | - ? str_repeat($horizontal, $this->_padding) . $intersection |
|
| 649 | + ? str_repeat($horizontal, $this->_padding).$intersection |
|
| 650 | 650 | : ''; |
| 651 | - $implode_char = str_repeat($horizontal, $this->_padding) . $intersection |
|
| 651 | + $implode_char = str_repeat($horizontal, $this->_padding).$intersection |
|
| 652 | 652 | . str_repeat($horizontal, $this->_padding); |
| 653 | - return $row_begin . implode($implode_char, $return) . $row_end; |
|
| 653 | + return $row_begin.implode($implode_char, $return).$row_end; |
|
| 654 | 654 | } |
| 655 | 655 | /** |
| 656 | 656 | * Returns the header line for the table. |
@@ -660,16 +660,16 @@ discard block |
||
| 660 | 660 | function _getHeaderLine() |
| 661 | 661 | {
|
| 662 | 662 | // Make sure column count is correct |
| 663 | - for ($j = 0; $j < count($this->_headers); $j++) {
|
|
| 664 | - for ($i = 0; $i < $this->_max_cols; $i++) {
|
|
| 663 | + for ($j = 0; $j<count($this->_headers); $j++) {
|
|
| 664 | + for ($i = 0; $i<$this->_max_cols; $i++) {
|
|
| 665 | 665 | if (!isset($this->_headers[$j][$i])) {
|
| 666 | 666 | $this->_headers[$j][$i] = ''; |
| 667 | 667 | } |
| 668 | 668 | } |
| 669 | 669 | } |
| 670 | - for ($j = 0; $j < count($this->_headers); $j++) {
|
|
| 671 | - for ($i = 0; $i < count($this->_headers[$j]); $i++) {
|
|
| 672 | - if ($this->_strlen($this->_headers[$j][$i]) < |
|
| 670 | + for ($j = 0; $j<count($this->_headers); $j++) {
|
|
| 671 | + for ($i = 0; $i<count($this->_headers[$j]); $i++) {
|
|
| 672 | + if ($this->_strlen($this->_headers[$j][$i])< |
|
| 673 | 673 | $this->_cell_lengths[$i]) {
|
| 674 | 674 | $this->_headers[$j][$i] = |
| 675 | 675 | $this->_strpad($this->_headers[$j][$i], |
@@ -681,20 +681,20 @@ discard block |
||
| 681 | 681 | } |
| 682 | 682 | $vertical = $this->_border['vertical']; |
| 683 | 683 | $row_begin = $this->_borderVisibility['left'] |
| 684 | - ? $vertical . str_repeat(' ', $this->_padding)
|
|
| 684 | + ? $vertical.str_repeat(' ', $this->_padding)
|
|
| 685 | 685 | : ''; |
| 686 | 686 | $row_end = $this->_borderVisibility['right'] |
| 687 | - ? str_repeat(' ', $this->_padding) . $vertical
|
|
| 687 | + ? str_repeat(' ', $this->_padding).$vertical
|
|
| 688 | 688 | : ''; |
| 689 | - $implode_char = str_repeat(' ', $this->_padding) . $vertical
|
|
| 689 | + $implode_char = str_repeat(' ', $this->_padding).$vertical
|
|
| 690 | 690 | . str_repeat(' ', $this->_padding);
|
| 691 | 691 | $separator = $this->_getSeparator(); |
| 692 | 692 | if (!empty($separator) && $this->_borderVisibility['top']) {
|
| 693 | 693 | $return[] = $separator; |
| 694 | 694 | } |
| 695 | - for ($j = 0; $j < count($this->_headers); $j++) {
|
|
| 695 | + for ($j = 0; $j<count($this->_headers); $j++) {
|
|
| 696 | 696 | $return[] = $row_begin |
| 697 | - . implode($implode_char, $this->_headers[$j]) . $row_end; |
|
| 697 | + . implode($implode_char, $this->_headers[$j]).$row_end; |
|
| 698 | 698 | } |
| 699 | 699 | return implode(PHP_EOL, $return); |
| 700 | 700 | } |
@@ -712,7 +712,7 @@ discard block |
||
| 712 | 712 | // Update maximum rows. |
| 713 | 713 | ksort($this->_data); |
| 714 | 714 | $keys = array_keys($this->_data); |
| 715 | - $this->_max_rows = end($keys) + 1; |
|
| 715 | + $this->_max_rows = end($keys)+1; |
|
| 716 | 716 | switch ($this->_defaultAlign) {
|
| 717 | 717 | case CONSOLE_TABLE_ALIGN_CENTER: |
| 718 | 718 | $pad = STR_PAD_BOTH; |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | break; |
| 726 | 726 | } |
| 727 | 727 | // Set default column alignments |
| 728 | - for ($i = 0; $i < $this->_max_cols; $i++) {
|
|
| 728 | + for ($i = 0; $i<$this->_max_cols; $i++) {
|
|
| 729 | 729 | if (!isset($this->_col_align[$i])) {
|
| 730 | 730 | $this->_col_align[$i] = $pad; |
| 731 | 731 | } |
@@ -740,7 +740,7 @@ discard block |
||
| 740 | 740 | */ |
| 741 | 741 | function _calculateCellLengths($row) |
| 742 | 742 | {
|
| 743 | - for ($i = 0; $i < count($row); $i++) {
|
|
| 743 | + for ($i = 0; $i<count($row); $i++) {
|
|
| 744 | 744 | if (!isset($this->_cell_lengths[$i])) {
|
| 745 | 745 | $this->_cell_lengths[$i] = 0; |
| 746 | 746 | } |
@@ -762,10 +762,10 @@ discard block |
||
| 762 | 762 | $this->_row_heights[$row_number] = 1; |
| 763 | 763 | } |
| 764 | 764 | // Do not process horizontal rule rows. |
| 765 | - if ($row === CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 765 | + if ($row===CONSOLE_TABLE_HORIZONTAL_RULE) {
|
|
| 766 | 766 | return; |
| 767 | 767 | } |
| 768 | - for ($i = 0, $c = count($row); $i < $c; ++$i) {
|
|
| 768 | + for ($i = 0, $c = count($row); $i<$c; ++$i) {
|
|
| 769 | 769 | $lines = preg_split('/\r?\n|\r/', $row[$i]);
|
| 770 | 770 | $this->_row_heights[$row_number] = max($this->_row_heights[$row_number], |
| 771 | 771 | count($lines)); |
@@ -841,31 +841,31 @@ discard block |
||
| 841 | 841 | $sb_length = strlen($input); |
| 842 | 842 | $pad_length = $this->_strlen($pad); |
| 843 | 843 | /* Return if we already have the length. */ |
| 844 | - if ($mb_length >= $length) {
|
|
| 844 | + if ($mb_length>=$length) {
|
|
| 845 | 845 | return $input; |
| 846 | 846 | } |
| 847 | 847 | /* Shortcut for single byte strings. */ |
| 848 | - if ($mb_length == $sb_length && $pad_length == strlen($pad)) {
|
|
| 848 | + if ($mb_length==$sb_length && $pad_length==strlen($pad)) {
|
|
| 849 | 849 | return str_pad($input, $length, $pad, $type); |
| 850 | 850 | } |
| 851 | 851 | switch ($type) {
|
| 852 | 852 | case STR_PAD_LEFT: |
| 853 | - $left = $length - $mb_length; |
|
| 853 | + $left = $length-$mb_length; |
|
| 854 | 854 | $output = $this->_substr(str_repeat($pad, ceil($left / $pad_length)), |
| 855 | - 0, $left, $this->_charset) . $input; |
|
| 855 | + 0, $left, $this->_charset).$input; |
|
| 856 | 856 | break; |
| 857 | 857 | case STR_PAD_BOTH: |
| 858 | - $left = floor(($length - $mb_length) / 2); |
|
| 859 | - $right = ceil(($length - $mb_length) / 2); |
|
| 858 | + $left = floor(($length-$mb_length) / 2); |
|
| 859 | + $right = ceil(($length-$mb_length) / 2); |
|
| 860 | 860 | $output = $this->_substr(str_repeat($pad, ceil($left / $pad_length)), |
| 861 | - 0, $left, $this->_charset) . |
|
| 862 | - $input . |
|
| 861 | + 0, $left, $this->_charset). |
|
| 862 | + $input. |
|
| 863 | 863 | $this->_substr(str_repeat($pad, ceil($right / $pad_length)), |
| 864 | 864 | 0, $right, $this->_charset); |
| 865 | 865 | break; |
| 866 | 866 | case STR_PAD_RIGHT: |
| 867 | - $right = $length - $mb_length; |
|
| 868 | - $output = $input . |
|
| 867 | + $right = $length-$mb_length; |
|
| 868 | + $output = $input. |
|
| 869 | 869 | $this->_substr(str_repeat($pad, ceil($right / $pad_length)), |
| 870 | 870 | 0, $right, $this->_charset); |
| 871 | 871 | break; |
@@ -51,8 +51,8 @@ |
||
| 51 | 51 | |
| 52 | 52 | $eventDispatchers=app()->resolve(ClosureDispatcher::class,['bind'=>app()['eventDispatcher']])->call(function(){
|
| 53 | 53 | return [ |
| 54 | - 'listen' => $this->listen, |
|
| 55 | - 'subscriber' => $this->subscribe |
|
| 54 | + 'listen' => $this->listen, |
|
| 55 | + 'subscriber' => $this->subscribe |
|
| 56 | 56 | ]; |
| 57 | 57 | }); |
| 58 | 58 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var $type |
| 16 | 16 | */ |
| 17 | - public $type='event'; |
|
| 17 | + public $type = 'event'; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var bool |
@@ -31,22 +31,22 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * @var $commandRule |
| 33 | 33 | */ |
| 34 | - protected $commandRule=[]; |
|
| 34 | + protected $commandRule = []; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @method create |
| 38 | 38 | * @return mixed |
| 39 | 39 | */ |
| 40 | - public function generate(){
|
|
| 40 | + public function generate() {
|
|
| 41 | 41 | |
| 42 | - $this->argument['source']=StaticPathList::$events; |
|
| 43 | - $this->argument['sourcelisten']=StaticPathList::$listeners; |
|
| 42 | + $this->argument['source'] = StaticPathList::$events; |
|
| 43 | + $this->argument['sourcelisten'] = StaticPathList::$listeners; |
|
| 44 | 44 | |
| 45 | - $this->argument['eventNamespace']=app()->namespace()->optionalEvents().''; |
|
| 46 | - $this->argument['listenNamespace']=app()->namespace()->optionalListeners().''; |
|
| 47 | - $this->argument['subscriberNamespace']=app()->namespace()->optionalSubscribers().''; |
|
| 45 | + $this->argument['eventNamespace'] = app()->namespace()->optionalEvents().''; |
|
| 46 | + $this->argument['listenNamespace'] = app()->namespace()->optionalListeners().''; |
|
| 47 | + $this->argument['subscriberNamespace'] = app()->namespace()->optionalSubscribers().''; |
|
| 48 | 48 | |
| 49 | - $eventDispatchers=app()->resolve(ClosureDispatcher::class,['bind'=>app()['eventDispatcher']])->call(function(){
|
|
| 49 | + $eventDispatchers = app()->resolve(ClosureDispatcher::class, ['bind'=>app()['eventDispatcher']])->call(function() {
|
|
| 50 | 50 | return [ |
| 51 | 51 | 'listen' => $this->listen, |
| 52 | 52 | 'subscriber' => $this->subscribe |
@@ -54,40 +54,40 @@ discard block |
||
| 54 | 54 | }); |
| 55 | 55 | |
| 56 | 56 | |
| 57 | - $this->directory['eventsDir']=path()->optionalEvents(); |
|
| 58 | - $this->directory['eventsListenDir']=path()->optionalListeners(); |
|
| 59 | - $this->directory['eventsListenSubscriberDir']=path()->optionalSubscribers(); |
|
| 57 | + $this->directory['eventsDir'] = path()->optionalEvents(); |
|
| 58 | + $this->directory['eventsListenDir'] = path()->optionalListeners(); |
|
| 59 | + $this->directory['eventsListenSubscriberDir'] = path()->optionalSubscribers(); |
|
| 60 | 60 | |
| 61 | 61 | //set project directory |
| 62 | 62 | $this->file->makeDirectory($this); |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - foreach ($eventDispatchers['listen'] as $event=>$listens){
|
|
| 66 | + foreach ($eventDispatchers['listen'] as $event=>$listens) {
|
|
| 67 | 67 | |
| 68 | 68 | |
| 69 | - $this->argument['eventMain']=ucfirst($event); |
|
| 69 | + $this->argument['eventMain'] = ucfirst($event); |
|
| 70 | 70 | |
| 71 | - $this->argument['eventKeyNamespace']=app()->namespace()->optionalEvents().'\\'.$this->argument['eventMain']; |
|
| 71 | + $this->argument['eventKeyNamespace'] = app()->namespace()->optionalEvents().'\\'.$this->argument['eventMain']; |
|
| 72 | 72 | |
| 73 | - $mainFile=$this->directory['eventsDir'].'/'.ucfirst($event).'.php'; |
|
| 73 | + $mainFile = $this->directory['eventsDir'].'/'.ucfirst($event).'.php'; |
|
| 74 | 74 | |
| 75 | - if(!file_exists($mainFile)){
|
|
| 76 | - $this->touch['event/main']=$mainFile; |
|
| 75 | + if (!file_exists($mainFile)) {
|
|
| 76 | + $this->touch['event/main'] = $mainFile; |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | //set project touch |
| 80 | 80 | $this->file->touch($this); |
| 81 | 81 | |
| 82 | 82 | |
| 83 | - foreach ($listens as $listen){
|
|
| 83 | + foreach ($listens as $listen) {
|
|
| 84 | 84 | |
| 85 | - $listenFile=$this->directory['eventsListenDir'].'/'.ucfirst($listen).'.php'; |
|
| 85 | + $listenFile = $this->directory['eventsListenDir'].'/'.ucfirst($listen).'.php'; |
|
| 86 | 86 | |
| 87 | - $this->argument['eventListen']=ucfirst($listen); |
|
| 87 | + $this->argument['eventListen'] = ucfirst($listen); |
|
| 88 | 88 | |
| 89 | - if(!file_exists($listenFile)){
|
|
| 90 | - $this->touch['event/listen']=$listenFile; |
|
| 89 | + if (!file_exists($listenFile)) {
|
|
| 90 | + $this->touch['event/listen'] = $listenFile; |
|
| 91 | 91 | |
| 92 | 92 | //set project touch |
| 93 | 93 | $this->file->touch($this); |
@@ -99,16 +99,16 @@ discard block |
||
| 99 | 99 | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | - foreach ($eventDispatchers['subscriber'] as $subscriber){
|
|
| 102 | + foreach ($eventDispatchers['subscriber'] as $subscriber) {
|
|
| 103 | 103 | |
| 104 | - $eventSubscriberName=''.ucfirst($subscriber); |
|
| 104 | + $eventSubscriberName = ''.ucfirst($subscriber); |
|
| 105 | 105 | |
| 106 | - $subscriberFile=$this->directory['eventsListenSubscriberDir'].'/'.$eventSubscriberName.'.php'; |
|
| 106 | + $subscriberFile = $this->directory['eventsListenSubscriberDir'].'/'.$eventSubscriberName.'.php'; |
|
| 107 | 107 | |
| 108 | - $this->argument['eventSubscriber']=$eventSubscriberName; |
|
| 108 | + $this->argument['eventSubscriber'] = $eventSubscriberName; |
|
| 109 | 109 | |
| 110 | - if(!file_exists($subscriberFile)){
|
|
| 111 | - $this->touch['event/subscriber']=$subscriberFile; |
|
| 110 | + if (!file_exists($subscriberFile)) {
|
|
| 111 | + $this->touch['event/subscriber'] = $subscriberFile; |
|
| 112 | 112 | |
| 113 | 113 | //set project touch |
| 114 | 114 | $this->file->touch($this); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var $type |
| 16 | 16 | */ |
| 17 | - public $type='middleware'; |
|
| 17 | + public $type = 'middleware'; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var array |
@@ -31,20 +31,20 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * @var $commandRule |
| 33 | 33 | */ |
| 34 | - public $commandRule=['middleware']; |
|
| 34 | + public $commandRule = ['middleware']; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @method create |
| 38 | 38 | * @return mixed |
| 39 | 39 | */ |
| 40 | - public function create(){
|
|
| 40 | + public function create() {
|
|
| 41 | 41 | |
| 42 | - $this->touch['middleware/middleware']= path()->middleware().'/'.$this->argument['middleware'].'.php'; |
|
| 42 | + $this->touch['middleware/middleware'] = path()->middleware().'/'.$this->argument['middleware'].'.php'; |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | $this->file->touch($this); |
| 46 | 46 | |
| 47 | - chmod($this->touch['middleware/middleware'],0777); |
|
| 47 | + chmod($this->touch['middleware/middleware'], 0777); |
|
| 48 | 48 | |
| 49 | 49 | echo $this->classical(' > Middleware called as "'.$this->argument['middleware'].'" has been successfully created in the '.app()->namespace()->middleware().'');
|
| 50 | 50 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var $type |
| 16 | 16 | */ |
| 17 | - public $type='boot'; |
|
| 17 | + public $type = 'boot'; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var array |
@@ -26,19 +26,19 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * @var $commandRule |
| 28 | 28 | */ |
| 29 | - protected $commandRule='boot'; |
|
| 29 | + protected $commandRule = 'boot'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @method create |
| 33 | 33 | * @return mixed |
| 34 | 34 | */ |
| 35 | - public function create(){
|
|
| 35 | + public function create() {
|
|
| 36 | 36 | |
| 37 | - $bootName=explode("\\",$this->argument['project']);
|
|
| 37 | + $bootName = explode("\\", $this->argument['project']);
|
|
| 38 | 38 | |
| 39 | - $this->argument['boot']=current($bootName); |
|
| 39 | + $this->argument['boot'] = current($bootName); |
|
| 40 | 40 | |
| 41 | - $this->touch['main/boot'] = StaticPathModel::bootDir().'/'.$this->argument['boot'].'.php'; |
|
| 41 | + $this->touch['main/boot'] = StaticPathModel::bootDir().'/'.$this->argument['boot'].'.php'; |
|
| 42 | 42 | |
| 43 | 43 | $this->file->touch($this); |
| 44 | 44 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * @var $type |
| 17 | 17 | */ |
| 18 | - public $type='key'; |
|
| 18 | + public $type = 'key'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @var array |
@@ -27,19 +27,19 @@ discard block |
||
| 27 | 27 | /** |
| 28 | 28 | * @var $commandRule |
| 29 | 29 | */ |
| 30 | - public $commandRule=[]; |
|
| 30 | + public $commandRule = []; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * @method generate |
| 34 | 34 | * @return mixed |
| 35 | 35 | */ |
| 36 | - public function generate(){
|
|
| 36 | + public function generate() {
|
|
| 37 | 37 | |
| 38 | 38 | //key generate file |
| 39 | - $this->touch['main/keygenerate']= StaticPathModel::getEncrypter(); |
|
| 39 | + $this->touch['main/keygenerate'] = StaticPathModel::getEncrypter(); |
|
| 40 | 40 | |
| 41 | 41 | //key generate code |
| 42 | - $this->argument['applicationKey']=app()['encrypter']->setCipherText(); |
|
| 42 | + $this->argument['applicationKey'] = app()['encrypter']->setCipherText(); |
|
| 43 | 43 | |
| 44 | 44 | //set key file touch |
| 45 | 45 | $this->file->touch($this); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var $type |
| 16 | 16 | */ |
| 17 | - public $type='env'; |
|
| 17 | + public $type = 'env'; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var array |
@@ -26,18 +26,18 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * @var $commandRule |
| 28 | 28 | */ |
| 29 | - protected $commandRule='env'; |
|
| 29 | + protected $commandRule = 'env'; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * @method create |
| 33 | 33 | * @return mixed |
| 34 | 34 | */ |
| 35 | - public function create(){
|
|
| 35 | + public function create() {
|
|
| 36 | 36 | |
| 37 | - $envFile= $this->checkGroupArgument($this->argument['project'],''); |
|
| 37 | + $envFile = $this->checkGroupArgument($this->argument['project'], ''); |
|
| 38 | 38 | |
| 39 | 39 | //key generate file |
| 40 | - $this->touch['main/env']= StaticPathModel::appPath().'/'.strtolower($envFile).'.yaml'; |
|
| 40 | + $this->touch['main/env'] = StaticPathModel::appPath().'/'.strtolower($envFile).'.yaml'; |
|
| 41 | 41 | |
| 42 | 42 | //set key file touch |
| 43 | 43 | $this->file->touch($this); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * @var $type |
| 17 | 17 | */ |
| 18 | - public $type='exception'; |
|
| 18 | + public $type = 'exception'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @var array |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @var $commandRule |
| 34 | 34 | */ |
| 35 | - public $commandRule=['exception']; |
|
| 35 | + public $commandRule = ['exception']; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @method create |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | //set project directory |
| 50 | 50 | $this->file->makeDirectory($this); |
| 51 | 51 | |
| 52 | - $this->touch['exception/exception'] =$this->directory['exceptionDir'].'/'.$exception.'Exception.php'; |
|
| 52 | + $this->touch['exception/exception'] = $this->directory['exceptionDir'].'/'.$exception.'Exception.php'; |
|
| 53 | 53 | |
| 54 | 54 | //set project touch |
| 55 | 55 | $this->file->touch($this); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * @var $type |
| 17 | 17 | */ |
| 18 | - public $type='provider'; |
|
| 18 | + public $type = 'provider'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @var array |
@@ -32,28 +32,28 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - protected $commandRule=[]; |
|
| 35 | + protected $commandRule = []; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @method create |
| 39 | 39 | * @return mixed |
| 40 | 40 | */ |
| 41 | - public function create(){
|
|
| 41 | + public function create() {
|
|
| 42 | 42 | |
| 43 | - $bootName=explode("\\",$this->argument['project']);
|
|
| 43 | + $bootName = explode("\\", $this->argument['project']);
|
|
| 44 | 44 | |
| 45 | - if(file_exists(app()->path()->app())){
|
|
| 45 | + if (file_exists(app()->path()->app())) {
|
|
| 46 | 46 | |
| 47 | - if(!isset($this->argument['provider'])) exception()->invalidArgument('Provider key is not valid');
|
|
| 47 | + if (!isset($this->argument['provider'])) exception()->invalidArgument('Provider key is not valid');
|
|
| 48 | 48 | |
| 49 | 49 | $this->argument['ProviderNamespace'] = app()->namespace()->provider(); |
| 50 | 50 | $this->touch['provider/provider'] = app()->path()->provider().'/'.$this->argument['provider'].'.php'; |
| 51 | 51 | } |
| 52 | - else{
|
|
| 52 | + else {
|
|
| 53 | 53 | |
| 54 | - $providerName = explode(":",current($bootName));
|
|
| 54 | + $providerName = explode(":", current($bootName));
|
|
| 55 | 55 | |
| 56 | - $this->argument['provider']=ucfirst(end($providerName)); |
|
| 56 | + $this->argument['provider'] = ucfirst(end($providerName)); |
|
| 57 | 57 | $this->argument['ProviderNamespace'] = 'Providers'; |
| 58 | 58 | $this->touch['provider/provider'] = StaticPathModel::providerDir().'/'.$this->argument['provider'].'.php'; |
| 59 | 59 | } |
@@ -44,12 +44,13 @@ |
||
| 44 | 44 | |
| 45 | 45 | if(file_exists(app()->path()->app())){
|
| 46 | 46 | |
| 47 | - if(!isset($this->argument['provider'])) exception()->invalidArgument('Provider key is not valid');
|
|
| 47 | + if(!isset($this->argument['provider'])) {
|
|
| 48 | + exception()->invalidArgument('Provider key is not valid');
|
|
| 49 | + } |
|
| 48 | 50 | |
| 49 | 51 | $this->argument['ProviderNamespace'] = app()->namespace()->provider(); |
| 50 | 52 | $this->touch['provider/provider'] = app()->path()->provider().'/'.$this->argument['provider'].'.php'; |
| 51 | - } |
|
| 52 | - else{
|
|
| 53 | + } else{
|
|
| 53 | 54 | |
| 54 | 55 | $providerName = explode(":",current($bootName));
|
| 55 | 56 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var $type |
| 16 | 16 | */ |
| 17 | - public $type='repository'; |
|
| 17 | + public $type = 'repository'; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @var array |
@@ -31,39 +31,39 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * @var $commandRule |
| 33 | 33 | */ |
| 34 | - public $commandRule=['repository','?source']; |
|
| 34 | + public $commandRule = ['repository', '?source']; |
|
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * @method create |
| 38 | 38 | * @return mixed |
| 39 | 39 | */ |
| 40 | - public function create(){
|
|
| 40 | + public function create() {
|
|
| 41 | 41 | |
| 42 | - $repository=$this->argument['repository']; |
|
| 42 | + $repository = $this->argument['repository']; |
|
| 43 | 43 | |
| 44 | - $repositoryPath=$this->repository().'/'.$repository; |
|
| 44 | + $repositoryPath = $this->repository().'/'.$repository; |
|
| 45 | 45 | |
| 46 | - $this->argument['repositoryNamespace']=Utils::getNamespace($repositoryPath); |
|
| 46 | + $this->argument['repositoryNamespace'] = Utils::getNamespace($repositoryPath); |
|
| 47 | 47 | |
| 48 | - if($this->sourceCreate()) return true; |
|
| 48 | + if ($this->sourceCreate()) return true; |
|
| 49 | 49 | |
| 50 | 50 | $this->directory['repositoryPath'] = $this->repository(); |
| 51 | - $this->directory['repositoryDir']=$repositoryPath; |
|
| 51 | + $this->directory['repositoryDir'] = $repositoryPath; |
|
| 52 | 52 | |
| 53 | - $this->directory['repositorySourceDir']=$this->repository().'/'.$repository.'/Source'; |
|
| 54 | - $this->directory['repositorySourceMainDir']=$this->directory['repositorySourceDir'].'/Main'; |
|
| 53 | + $this->directory['repositorySourceDir'] = $this->repository().'/'.$repository.'/Source'; |
|
| 54 | + $this->directory['repositorySourceMainDir'] = $this->directory['repositorySourceDir'].'/Main'; |
|
| 55 | 55 | |
| 56 | 56 | //set project directory |
| 57 | 57 | $this->file->makeDirectory($this); |
| 58 | 58 | |
| 59 | - $this->touch['repository/adapter'] =$this->directory['repositoryDir'].'/'.$repository.'Adapter.php'; |
|
| 60 | - $this->touch['repository/contract'] =$this->directory['repositoryDir'].'/'.$repository.'Contract.php'; |
|
| 59 | + $this->touch['repository/adapter'] = $this->directory['repositoryDir'].'/'.$repository.'Adapter.php'; |
|
| 60 | + $this->touch['repository/contract'] = $this->directory['repositoryDir'].'/'.$repository.'Contract.php'; |
|
| 61 | 61 | //$this->touch['repository/trait'] =$this->directory['repositoryDir'].'/'.$repository.'Trait.php'; |
| 62 | 62 | |
| 63 | - $this->touch['repository/sourcemain'] =$this->directory['repositorySourceMainDir'].'/'.$repository.'Main.php'; |
|
| 63 | + $this->touch['repository/sourcemain'] = $this->directory['repositorySourceMainDir'].'/'.$repository.'Main.php'; |
|
| 64 | 64 | |
| 65 | 65 | //set project touch |
| 66 | - $this->file->touch($this,[ |
|
| 66 | + $this->file->touch($this, [ |
|
| 67 | 67 | 'stub'=>'Repository_Create' |
| 68 | 68 | ]); |
| 69 | 69 | |
@@ -77,16 +77,16 @@ discard block |
||
| 77 | 77 | /** |
| 78 | 78 | * @return bool |
| 79 | 79 | */ |
| 80 | - private function sourceCreate(){
|
|
| 80 | + private function sourceCreate() {
|
|
| 81 | 81 | |
| 82 | - if(isset($this->argument['source'])){
|
|
| 82 | + if (isset($this->argument['source'])) {
|
|
| 83 | 83 | |
| 84 | - $this->directory['repositorySourceCustomDir']=$this->repository().'/'.$this->argument['repository'].'/Source/'.$this->argument['source']; |
|
| 84 | + $this->directory['repositorySourceCustomDir'] = $this->repository().'/'.$this->argument['repository'].'/Source/'.$this->argument['source']; |
|
| 85 | 85 | |
| 86 | 86 | //set project directory |
| 87 | 87 | $this->file->makeDirectory($this); |
| 88 | 88 | |
| 89 | - $this->touch['repository/sourcecustommain']=$this->directory['repositorySourceCustomDir'].'/'.$this->argument['repository'].''.$this->argument['source'].'.php'; |
|
| 89 | + $this->touch['repository/sourcecustommain'] = $this->directory['repositorySourceCustomDir'].'/'.$this->argument['repository'].''.$this->argument['source'].'.php'; |
|
| 90 | 90 | |
| 91 | 91 | //set project touch |
| 92 | 92 | $this->file->touch($this); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | /** |
| 103 | 103 | * @return bool |
| 104 | 104 | */ |
| 105 | - private function setAnnotations(){
|
|
| 105 | + private function setAnnotations() {
|
|
| 106 | 106 | |
| 107 | 107 | return Utils::changeClass(path()->version().'/ServiceAnnotationsManager.php', |
| 108 | 108 | ['Trait ServiceAnnotationsManager'=>'Trait ServiceAnnotationsManager'.PHP_EOL.' * @method \\'.app()->namespace()->repository().'\\'.$this->argument['repository'].'\\'.$this->argument['repository'].'Contract '.lcfirst($this->argument['repository']).'Repository' |
@@ -45,7 +45,9 @@ |
||
| 45 | 45 | |
| 46 | 46 | $this->argument['repositoryNamespace']=Utils::getNamespace($repositoryPath); |
| 47 | 47 | |
| 48 | - if($this->sourceCreate()) return true; |
|
| 48 | + if($this->sourceCreate()) {
|
|
| 49 | + return true; |
|
| 50 | + } |
|
| 49 | 51 | |
| 50 | 52 | $this->directory['repositoryPath'] = $this->repository(); |
| 51 | 53 | $this->directory['repositoryDir']=$repositoryPath; |