PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 All 36 releases
← All changes | includes/sdk/google/google/gax/src/ResourceTemplate/Segment.php +7 -7 1.2.3 → 1.4.2 View file →
@@ -29,11 +29,11 @@
29 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 32 */
33 -namespace Dudlewebs\WPMCS\Google\ApiCore\ResourceTemplate;
33 +namespace Dudlewebs\WPMCS\GCP\Google\ApiCore\ResourceTemplate;
34 34
35 -use Dudlewebs\WPMCS\Google\ApiCore\ValidationException;
35 +use Dudlewebs\WPMCS\GCP\Google\ApiCore\ValidationException;
36 36 /**
37 37 * Represents a segment in a resource template. This is used internally by RelativeResourceTemplate,
38 38 * but is not intended for public use and may change without notice.
39 39 *
@@ -59,9 +59,9 @@
59 59 * @param RelativeResourceTemplate|null $template
60 60 * @param string $separator The separator that belongs at the end of a segment. Ending segments should use '/'.
61 61 * @throws ValidationException
62 62 */
63 - public function __construct(int $segmentType, string $value = null, string $key = null, RelativeResourceTemplate $template = null, string $separator = '/')
63 + public function __construct(int $segmentType, ?string $value = null, ?string $key = null, ?RelativeResourceTemplate $template = null, string $separator = '/')
64 64 {
65 65 $this->segmentType = $segmentType;
66 66 $this->value = $value;
67 67 $this->key = $key;
@@ -71,12 +71,12 @@
71 71 case Segment::LITERAL_SEGMENT:
72 72 $this->stringRepr = "{$this->value}";
73 73 break;
74 74 case Segment::WILDCARD_SEGMENT:
75 - $this->stringRepr = "*";
75 + $this->stringRepr = '*';
76 76 break;
77 77 case Segment::DOUBLE_WILDCARD_SEGMENT:
78 - $this->stringRepr = "**";
78 + $this->stringRepr = '**';
79 79 break;
80 80 case Segment::VARIABLE_SEGMENT:
81 81 $this->stringRepr = "{{$this->key}={$this->template}}";
82 82 break;
@@ -156,9 +156,9 @@
156 156 * @return bool
157 157 */
158 158 private static function isValidBinding(string $binding)
159 159 {
160 - return preg_match("-^[^/]+\$-", $binding) === 1;
160 + return \preg_match('-^[^/]+$-', $binding) === 1;
161 161 }
162 162 /**
163 163 * Check if $binding is a valid double wildcard binding. Segment bindings may contain any
164 164 * characters, but may not be empty.
@@ -167,7 +167,7 @@
167 167 * @return bool
168 168 */
169 169 private static function isValidDoubleWildcardBinding(string $binding)
170 170 {
171 - return preg_match("-^.+\$-", $binding) === 1;
171 + return \preg_match('-^.+$-', $binding) === 1;
172 172 }
173 173 }