File tree Expand file tree Collapse file tree 1 file changed +25
-3
lines changed
Expand file tree Collapse file tree 1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -70,15 +70,37 @@ public function shouldCache()
7070 */
7171 private function validateOptions ($ maxBatchSize , $ shouldBatch , $ shouldCache )
7272 {
73- if (! is_bool ($ shouldBatch )) {
73+ $ this ->validateMaxBatchSizeOption ($ maxBatchSize );
74+ $ this ->validateBatchOption ($ shouldBatch );
75+ $ this ->validateCacheOption ($ shouldCache );
76+ }
77+
78+ /**
79+ * @param bool $shouldBatch
80+ */
81+ private function validateBatchOption ($ shouldBatch )
82+ {
83+ if (!is_bool ($ shouldBatch )) {
7484 throw new \InvalidArgumentException ('Expected argument $shouldBatch to be a boolean ' );
7585 }
86+ }
7687
77- if (! is_bool ($ shouldCache )) {
88+ /**
89+ * @param bool $shouldCache
90+ */
91+ private function validateCacheOption ($ shouldCache )
92+ {
93+ if (!is_bool ($ shouldCache )) {
7894 throw new \InvalidArgumentException ('Expected argument $shouldCache to be a boolean ' );
7995 }
96+ }
8097
81- if ($ maxBatchSize !== null && ! is_int ($ maxBatchSize )) {
98+ /**
99+ * @param null|int $maxBatchSize
100+ */
101+ private function validateMaxBatchSizeOption ($ maxBatchSize )
102+ {
103+ if ($ maxBatchSize !== null && !is_int ($ maxBatchSize )) {
82104 throw new \InvalidArgumentException ('Expected argument $maxBatchSize to be null or an integer ' );
83105 }
84106 }
You can’t perform that action at this time.
0 commit comments