@@ -25,9 +25,11 @@ |
||
| 25 | 25 | * |
| 26 | 26 | * @return void |
| 27 | 27 | */ |
| 28 | - public function do() |
|
| 28 | + public function do { |
|
| 29 | + () |
|
| 29 | 30 | { |
| 30 | 31 | global $globalaaa, $globalbbb; |
| 32 | + } |
|
| 31 | 33 | echo 'dobbb'."\n"; |
| 32 | 34 | $globalaaa.='+bbb'; |
| 33 | 35 | $globalbbb.='+bbb'; |
@@ -27,8 +27,10 @@ |
||
| 27 | 27 | * |
| 28 | 28 | * @return void |
| 29 | 29 | */ |
| 30 | - public function do() |
|
| 30 | + public function do { |
|
| 31 | + () |
|
| 31 | 32 | { |
| 32 | 33 | echo 'doaaa'."\n"; |
| 33 | 34 | } |
| 35 | + } |
|
| 34 | 36 | } |
@@ -60,16 +60,16 @@ |
||
| 60 | 60 | if (is_array($elems)) { |
| 61 | 61 | foreach ($elems as $elem) { |
| 62 | 62 | switch ($elem['name']) { |
| 63 | - case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
| 64 | - $result['is-not-defined'] = true; |
|
| 65 | - break; |
|
| 66 | - case '{'.Plugin::NS_CALDAV.'}text-match': |
|
| 67 | - $result['text-match'] = [ |
|
| 68 | - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
| 69 | - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', |
|
| 70 | - 'value' => $elem['value'], |
|
| 71 | - ]; |
|
| 72 | - break; |
|
| 63 | + case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
| 64 | + $result['is-not-defined'] = true; |
|
| 65 | + break; |
|
| 66 | + case '{'.Plugin::NS_CALDAV.'}text-match': |
|
| 67 | + $result['text-match'] = [ |
|
| 68 | + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
| 69 | + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', |
|
| 70 | + 'value' => $elem['value'], |
|
| 71 | + ]; |
|
| 72 | + break; |
|
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -64,27 +64,27 @@ |
||
| 64 | 64 | if (is_array($elems)) { |
| 65 | 65 | foreach ($elems as $elem) { |
| 66 | 66 | switch ($elem['name']) { |
| 67 | - case '{'.Plugin::NS_CALDAV.'}comp-filter': |
|
| 68 | - $result['comp-filters'][] = $elem['value']; |
|
| 69 | - break; |
|
| 70 | - case '{'.Plugin::NS_CALDAV.'}prop-filter': |
|
| 71 | - $result['prop-filters'][] = $elem['value']; |
|
| 72 | - break; |
|
| 73 | - case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
| 74 | - $result['is-not-defined'] = true; |
|
| 75 | - break; |
|
| 76 | - case '{'.Plugin::NS_CALDAV.'}time-range': |
|
| 77 | - if ('VCALENDAR' === $result['name']) { |
|
| 78 | - throw new BadRequest('You cannot add time-range filters on the VCALENDAR component'); |
|
| 79 | - } |
|
| 80 | - $result['time-range'] = [ |
|
| 81 | - 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, |
|
| 82 | - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, |
|
| 83 | - ]; |
|
| 84 | - if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { |
|
| 85 | - throw new BadRequest('The end-date must be larger than the start-date'); |
|
| 86 | - } |
|
| 87 | - break; |
|
| 67 | + case '{'.Plugin::NS_CALDAV.'}comp-filter': |
|
| 68 | + $result['comp-filters'][] = $elem['value']; |
|
| 69 | + break; |
|
| 70 | + case '{'.Plugin::NS_CALDAV.'}prop-filter': |
|
| 71 | + $result['prop-filters'][] = $elem['value']; |
|
| 72 | + break; |
|
| 73 | + case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
| 74 | + $result['is-not-defined'] = true; |
|
| 75 | + break; |
|
| 76 | + case '{'.Plugin::NS_CALDAV.'}time-range': |
|
| 77 | + if ('VCALENDAR' === $result['name']) { |
|
| 78 | + throw new BadRequest('You cannot add time-range filters on the VCALENDAR component'); |
|
| 79 | + } |
|
| 80 | + $result['time-range'] = [ |
|
| 81 | + 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, |
|
| 82 | + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, |
|
| 83 | + ]; |
|
| 84 | + if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { |
|
| 85 | + throw new BadRequest('The end-date must be larger than the start-date'); |
|
| 86 | + } |
|
| 87 | + break; |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | } |
@@ -64,28 +64,28 @@ |
||
| 64 | 64 | if (is_array($elems)) { |
| 65 | 65 | foreach ($elems as $elem) { |
| 66 | 66 | switch ($elem['name']) { |
| 67 | - case '{'.Plugin::NS_CALDAV.'}param-filter': |
|
| 68 | - $result['param-filters'][] = $elem['value']; |
|
| 69 | - break; |
|
| 70 | - case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
| 71 | - $result['is-not-defined'] = true; |
|
| 72 | - break; |
|
| 73 | - case '{'.Plugin::NS_CALDAV.'}time-range': |
|
| 74 | - $result['time-range'] = [ |
|
| 75 | - 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, |
|
| 76 | - 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, |
|
| 77 | - ]; |
|
| 78 | - if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { |
|
| 79 | - throw new BadRequest('The end-date must be larger than the start-date'); |
|
| 80 | - } |
|
| 81 | - break; |
|
| 82 | - case '{'.Plugin::NS_CALDAV.'}text-match': |
|
| 83 | - $result['text-match'] = [ |
|
| 84 | - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
| 85 | - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', |
|
| 86 | - 'value' => $elem['value'], |
|
| 87 | - ]; |
|
| 88 | - break; |
|
| 67 | + case '{'.Plugin::NS_CALDAV.'}param-filter': |
|
| 68 | + $result['param-filters'][] = $elem['value']; |
|
| 69 | + break; |
|
| 70 | + case '{'.Plugin::NS_CALDAV.'}is-not-defined': |
|
| 71 | + $result['is-not-defined'] = true; |
|
| 72 | + break; |
|
| 73 | + case '{'.Plugin::NS_CALDAV.'}time-range': |
|
| 74 | + $result['time-range'] = [ |
|
| 75 | + 'start' => isset($elem['attributes']['start']) ? DateTimeParser::parseDateTime($elem['attributes']['start']) : null, |
|
| 76 | + 'end' => isset($elem['attributes']['end']) ? DateTimeParser::parseDateTime($elem['attributes']['end']) : null, |
|
| 77 | + ]; |
|
| 78 | + if ($result['time-range']['start'] && $result['time-range']['end'] && $result['time-range']['end'] <= $result['time-range']['start']) { |
|
| 79 | + throw new BadRequest('The end-date must be larger than the start-date'); |
|
| 80 | + } |
|
| 81 | + break; |
|
| 82 | + case '{'.Plugin::NS_CALDAV.'}text-match': |
|
| 83 | + $result['text-match'] = [ |
|
| 84 | + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
| 85 | + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;ascii-casemap', |
|
| 86 | + 'value' => $elem['value'], |
|
| 87 | + ]; |
|
| 88 | + break; |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -61,22 +61,22 @@ |
||
| 61 | 61 | if (is_array($elems)) { |
| 62 | 62 | foreach ($elems as $elem) { |
| 63 | 63 | switch ($elem['name']) { |
| 64 | - case '{'.Plugin::NS_CARDDAV.'}is-not-defined': |
|
| 65 | - $result['is-not-defined'] = true; |
|
| 66 | - break; |
|
| 67 | - case '{'.Plugin::NS_CARDDAV.'}text-match': |
|
| 68 | - $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; |
|
| 64 | + case '{'.Plugin::NS_CARDDAV.'}is-not-defined': |
|
| 65 | + $result['is-not-defined'] = true; |
|
| 66 | + break; |
|
| 67 | + case '{'.Plugin::NS_CARDDAV.'}text-match': |
|
| 68 | + $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; |
|
| 69 | 69 | |
| 70 | - if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { |
|
| 71 | - throw new BadRequest('Unknown match-type: '.$matchType); |
|
| 72 | - } |
|
| 73 | - $result['text-match'] = [ |
|
| 74 | - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
| 75 | - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', |
|
| 76 | - 'value' => $elem['value'], |
|
| 77 | - 'match-type' => $matchType, |
|
| 78 | - ]; |
|
| 79 | - break; |
|
| 70 | + if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { |
|
| 71 | + throw new BadRequest('Unknown match-type: '.$matchType); |
|
| 72 | + } |
|
| 73 | + $result['text-match'] = [ |
|
| 74 | + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
| 75 | + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', |
|
| 76 | + 'value' => $elem['value'], |
|
| 77 | + 'match-type' => $matchType, |
|
| 78 | + ]; |
|
| 79 | + break; |
|
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | } |
@@ -67,25 +67,25 @@ |
||
| 67 | 67 | if (is_array($elems)) { |
| 68 | 68 | foreach ($elems as $elem) { |
| 69 | 69 | switch ($elem['name']) { |
| 70 | - case '{'.Plugin::NS_CARDDAV.'}param-filter': |
|
| 71 | - $result['param-filters'][] = $elem['value']; |
|
| 72 | - break; |
|
| 73 | - case '{'.Plugin::NS_CARDDAV.'}is-not-defined': |
|
| 74 | - $result['is-not-defined'] = true; |
|
| 75 | - break; |
|
| 76 | - case '{'.Plugin::NS_CARDDAV.'}text-match': |
|
| 77 | - $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; |
|
| 70 | + case '{'.Plugin::NS_CARDDAV.'}param-filter': |
|
| 71 | + $result['param-filters'][] = $elem['value']; |
|
| 72 | + break; |
|
| 73 | + case '{'.Plugin::NS_CARDDAV.'}is-not-defined': |
|
| 74 | + $result['is-not-defined'] = true; |
|
| 75 | + break; |
|
| 76 | + case '{'.Plugin::NS_CARDDAV.'}text-match': |
|
| 77 | + $matchType = isset($elem['attributes']['match-type']) ? $elem['attributes']['match-type'] : 'contains'; |
|
| 78 | 78 | |
| 79 | - if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { |
|
| 80 | - throw new BadRequest('Unknown match-type: '.$matchType); |
|
| 81 | - } |
|
| 82 | - $result['text-matches'][] = [ |
|
| 83 | - 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
| 84 | - 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', |
|
| 85 | - 'value' => $elem['value'], |
|
| 86 | - 'match-type' => $matchType, |
|
| 87 | - ]; |
|
| 88 | - break; |
|
| 79 | + if (!in_array($matchType, ['contains', 'equals', 'starts-with', 'ends-with'])) { |
|
| 80 | + throw new BadRequest('Unknown match-type: '.$matchType); |
|
| 81 | + } |
|
| 82 | + $result['text-matches'][] = [ |
|
| 83 | + 'negate-condition' => isset($elem['attributes']['negate-condition']) && 'yes' === $elem['attributes']['negate-condition'], |
|
| 84 | + 'collation' => isset($elem['attributes']['collation']) ? $elem['attributes']['collation'] : 'i;unicode-casemap', |
|
| 85 | + 'value' => $elem['value'], |
|
| 86 | + 'match-type' => $matchType, |
|
| 87 | + ]; |
|
| 88 | + break; |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | } |
@@ -25,8 +25,9 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public static function contains($haystack, $needle, $caseSensitive = true) |
| 27 | 27 | { |
| 28 | - if (empty($needle)) |
|
| 29 | - return true; |
|
| 28 | + if (empty($needle)) { |
|
| 29 | + return true; |
|
| 30 | + } |
|
| 30 | 31 | return $caseSensitive |
| 31 | 32 | ? strpos($haystack, $needle) !== false |
| 32 | 33 | : stripos($haystack, $needle) !== false; |
@@ -62,7 +63,9 @@ discard block |
||
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | // @CHANGE LDR |
| 65 | - if (!is_string($haystack)) return false; |
|
| 66 | + if (!is_string($haystack)) { |
|
| 67 | + return false; |
|
| 68 | + } |
|
| 66 | 69 | |
| 67 | 70 | return (substr($haystack, -$length) === $needle); |
| 68 | 71 | } |
@@ -25,9 +25,13 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $copy = array(); |
| 27 | 27 | foreach ($arr as $key => $value) { |
| 28 | - if (is_array($value)) $copy[$key] = static::copy($value); |
|
| 29 | - else if (is_object($value)) $copy[$key] = clone $value; |
|
| 30 | - else $copy[$key] = $value; |
|
| 28 | + if (is_array($value)) { |
|
| 29 | + $copy[$key] = static::copy($value); |
|
| 30 | + } else if (is_object($value)) { |
|
| 31 | + $copy[$key] = clone $value; |
|
| 32 | + } else { |
|
| 33 | + $copy[$key] = $value; |
|
| 34 | + } |
|
| 31 | 35 | } |
| 32 | 36 | return $copy; |
| 33 | 37 | } |