1 | <?php |
||
19 | abstract class Log extends Base |
||
20 | { |
||
21 | /** |
||
22 | * Pretty log format. |
||
23 | * --pretty |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $format = '%h -%d %s (%ci) <%an>'; |
||
28 | |||
29 | /** |
||
30 | * Include or hide merge commits. |
||
31 | * --no-merges |
||
32 | * |
||
33 | * @var string |
||
34 | */ |
||
35 | protected $merges = ' --no-merges'; |
||
36 | |||
37 | /** |
||
38 | * Shorten commit hashes. |
||
39 | * --abbrev-commit |
||
40 | * |
||
41 | * @var bool |
||
42 | */ |
||
43 | protected $abbrev = ' --abbrev-commit'; |
||
44 | |||
45 | /** |
||
46 | * Can be revision or date query. |
||
47 | * 1.0.0.. |
||
48 | * 0.9.0..1.2.0 |
||
49 | * --after='2016-12-31' |
||
50 | * --after='2016-12-31' --before='2017-01-31' |
||
51 | * |
||
52 | * @var string |
||
53 | */ |
||
54 | protected $since; |
||
55 | |||
56 | /** |
||
57 | * Filter log by author. |
||
58 | * --author |
||
59 | * |
||
60 | * @var string |
||
61 | */ |
||
62 | protected $author; |
||
63 | |||
64 | /** |
||
65 | * Define the pretty log format. |
||
66 | * |
||
67 | * @param string $format |
||
68 | * @return \SebastianFeldmann\Git\Command\Log\Log |
||
69 | */ |
||
70 | 2 | public function prettyFormat(string $format) : Log |
|
75 | |||
76 | /** |
||
77 | * Define merge commit behaviour. |
||
78 | * |
||
79 | * @param bool $bool |
||
80 | * @return \SebastianFeldmann\Git\Command\Log\Log |
||
81 | */ |
||
82 | 1 | public function withMerges(bool $bool = true) : Log |
|
87 | |||
88 | /** |
||
89 | * Define commit hash behaviour. |
||
90 | * |
||
91 | * @param bool $bool |
||
92 | * @return \SebastianFeldmann\Git\Command\Log\Log |
||
93 | */ |
||
94 | 1 | public function abbrevCommit(bool $bool = true) : Log |
|
99 | |||
100 | /** |
||
101 | * Set revision range. |
||
102 | * |
||
103 | * @param string $from |
||
104 | * @param string $to |
||
105 | * @return \SebastianFeldmann\Git\Command\Log\Log |
||
106 | */ |
||
107 | 4 | public function byRevision(string $from, string $to = '') : Log |
|
113 | |||
114 | /** |
||
115 | * Set author filter. |
||
116 | * |
||
117 | * @param string $author |
||
118 | * @return \SebastianFeldmann\Git\Command\Log\Log |
||
119 | */ |
||
120 | 1 | public function authoredBy(string $author) : Log |
|
125 | |||
126 | /** |
||
127 | * Set date range. |
||
128 | * |
||
129 | * @param string $from |
||
130 | * @param string $to |
||
131 | * @return \SebastianFeldmann\Git\Command\Log\Log |
||
132 | */ |
||
133 | 2 | public function byDate(string $from, string $to = '') : Log |
|
139 | } |
||
140 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.