profile
viewpoint

bshaffer/csDoctrineActAsSortablePlugin 29

Sortable behavior for Doctrine objects

bshaffer/csDoctrineActAsGeolocatablePlugin 14

Automatically fetch latitude and longitude for your Doctrine model

bshaffer/csSettingsPlugin 13

Add simple user-editable settings to your application

bshaffer/csDoctrineActAsAttachablePlugin 6

Attachable Behavior for file uploads

bshaffer/csSecurityTaskExtraPlugin 5

Task for assessing the security coverage of your application

bshaffer/csBackupPlugin 3

A plugin for easily backing up your MySQL database, Rsyncing files, etc.

bshaffer/BasicParameterValidation 2

Basic Parameter Validator for PHP

bshaffer/ChartDown 2

Short Hand for Chart Writing

bshaffer/dlib-elixir 2

dlib for Elixir

bshaffer/analytics-realtime-dashboard-example 1

A Demo Application in Javascript

issue openedgoogleapis/gapic-generator-php

Make resource name helper names based off Resource instead of the last parameter name

We are encountering BC issues with libraries which change a variable name in their template path. This should not be a BC breaking change, but it is, because we use the last parameter in the sequence to determine the template path. For example, when the following resource path was added:

pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key_path}"

It generated the following method:

public static function cryptoKeyPathName($project, $location, $keyRing, $cryptoKeyPath)

It would be better if this was based off the resource name, so in this case it would be cryptoKey (which also exists and is identical in functionality).

If we base the template names off the resource instead of the parameters, this is both more reliable and will allow parameter names to be changed without breaking backwards compatibility.

created time in 19 hours

PR opened firebase/php-jwt

chore: update changelog for v6.0.0
+8 -0

0 comment

1 changed file

pr created time in 20 hours

create barnchfirebase/php-jwt

branch : bshaffer-patch-1

created branch time in 20 hours

push eventgoogleapis/google-cloud-php

Saransh Dhingra

commit sha c81eea7ce21a8f2aaed92e9bc4ed5cce5c336b91

fix: [Core] Add a default argument to ArrayTrait::isAssoc (#5024)

view details

push time in 20 hours

issue closedgoogleapis/google-cloud-php

BigQuery: Query fails when empty array is sent as parameter

If you send an empty array as parameter for a query, the client will interpret the empty array as STRUCT instead of ARRAY type due to an array values validation. The workaround will be sending and array with at least one value that you know in advance is not present in the column you want to validate.

How to replicate

$query = 'SELECT message FROM `bigquery-public-data.github_repos.commits`' .
         'WHERE message IN UNNEST (?) LIMIT 100';
$queryJobConfig = $bigQuery->query($query)
    ->parameters([[]]);
$queryResults = $bigQuery->runQuery($queryJobConfig);

Error thrown

'reason' => 'invalidQuery',   'location' => 'query',   'message' => 'Second argument of IN UNNEST must be an array but was STRUCT<>'

Reason of the error On this line of the ValueMapper, the isAssoc function will return true since [] != [0, -1] , making the value type as STRUCT. https://github.com/googleapis/google-cloud-php-bigquery/blob/master/src/ValueMapper.php#L197

case 'array':
            list($pType, $pValue) = $this->isAssoc($value)
                ? $this->assocArrayToParameter($value)
                : $this->arrayToParameter($value);

private function isAssoc(array $arr)
    {
        return array_keys($arr) !== range(0, count($arr) - 1);
    }

Potential solution would be adding an empty validation:

list($pType, $pValue) = $this->isAssoc($value) && !empty($value)
                ? $this->assocArrayToParameter($value)
                : $this->arrayToParameter($value);

Environment details

  • OS: CentOS Linux 7 (Core)
  • PHP version: 7.3.25
  • Package version: 1.11

closed time in 20 hours

davidnhz

PR merged googleapis/google-cloud-php

fix(Core): Add a default argument to ArrayTrait::isAssoc

The new argument $onEmpty is returned when the input array is empty.

ValueMapper in BigQuery should receive a false on passing an empty array to isAssoc.

Should fix #3937's error message.

+37 -5

0 comment

3 changed files

saranshdhingra

pr closed time in 20 hours

PullRequestReviewEvent

issue commentfirebase/php-jwt

RFC: Return type for `JWT::decode` in `v6.0`

@ivanrey thank you for your feedback, and I agree

bshaffer

comment created time in 20 hours

issue commentfirebase/php-jwt

$key problem in JWT.php | Expected type 'object'. Found 'array'.

Closing due to inactivity but please reopen if you are still encountering this error

Liuc-0392

comment created time in 20 hours

issue closedfirebase/php-jwt

$key problem in JWT.php | Expected type 'object'. Found 'array'.

Hi, it's not blocker, but VSCode notified me this problem inside file JWT.php at lines 117 and 125. For my application, the encode and decode operations are working fine but it seemed right to point it out.

Release v5.5.1 PHP version 7.4

Thank you. Luca

$keyProblem

closed time in 20 hours

Liuc-0392

issue closedfirebase/php-jwt

$keyOrKeyArray must be an instance of Firebase\JWT\Key

I'm noticing that the most recent commit https://github.com/firebase/php-jwt/commit/edda0f9ee45b8367699804f792a9be6d5175e816 is causing a program that was working previously to fail with this error message:

Fatal error: Uncaught UnexpectedValueException: $keyOrKeyArray must be an instance of Firebase\JWT\Key key or an array of Firebase\JWT\Key keys in /vendor/firebase/php-jwt/src/JWT.php:416
Stack trace:
#0 /vendor/firebase/php-jwt/src/JWT.php(114): Firebase\JWT\JWT::getKey('-----BEGIN CERT...', NULL)
#1 app.php(422): Firebase\JWT\JWT::decode('eyJ0eXAiOiJKV1Q...', '-----BEGIN CERT...', Array)

When I revert back to commit fbe639489d3348ff6e6d91f80b15198b39dc9217 it works fine. Just wanted to bring this to attention of maintainers.

I'm calling it like this:

JWT::decode($jwt, $public_key, ['RS256']);

But it looks like the third param was removed by that commit: image

I'm going to revert for now until I have some more time to properly look at what I need to do to be compatible with most recent commit.

closed time in 20 hours

tegansnyder

push eventgoogleapis/gapic-generator-php

Brent Shaffer

commit sha e62b2103f9b3ff47e2c2fecb792d49c291b92c02

feat: add manual fix for bc-breaking changes (#439)

view details

push time in 2 days

delete branch googleapis/gapic-generator-php

delete branch : fix-bc-breaking-changes

delete time in 2 days

PullRequestReviewEvent

push eventgoogleapis/gapic-generator-php

Brent Shaffer

commit sha 72413ac831332a20308a59b6c921844d6cca6fe5

remove redundant unit tests

view details

push time in 2 days

issue closedgoogleapis/google-cloud-php

[Spanner] updating google/gax to v1.11 throws Fatal Error in ServerStreamingCallWrapper

Seems like https://github.com/googleapis/gax-php/pull/347 broke the SpannerClient.

Upgrading to google/gax v1.11.0 produced the following error.

Fatal error: Uncaught TypeError: Argument 1 passed to Google\ApiCore\Transport\Grpc\ServerStreamingCallWrapper::__construct() must be an instance of Grpc\ServerStreamingCall, instance of Grpc\Gcp\GCPServerStreamCall given, called in /app/vendor/google/gax/src/Transport/GrpcTransport.php on line 208 and defined in /app/vendor/google/gax/src/Transport/Grpc/ServerStreamingCallWrapper.php:49
Stack trace:
#0 /app/vendor/google/gax/src/Transport/GrpcTransport.php(208): Google\ApiCore\Transport\Grpc\ServerStreamingCallWrapper->__construct(Object(Grpc\Gcp\GCPServerStreamCall))
#1 /app/vendor/google/gax/src/GapicClientTrait.php(608): Google\ApiCore\Transport\GrpcTransport->startServerStreamingCall(Object(Google\ApiCore\Call), Array)
#2 /app/vendor/google/gax/src/Middleware/CredentialsWrapperMiddleware.php(61): Google\Cloud\Spanner\V1\Gapic\SpannerGapicClient->Google\ApiCore\{closure}(Object(Google\ApiCore\Call), Array)
#3 /app/vendor/google/gax/src/Middleware/FixedHeaderMiddleware.php(66): Google\ApiCore\Middleware\CredentialsWrap in /app/vendor/google/gax/src/Transport/Grpc/ServerStreamingCallWrapper.php on line 49

It's only reproducible when I have sysvshm extensions enabled so I'm guessing it has something to do with https://github.com/googleapis/gax-php/blob/14e5bbd14b41c9602623a70d35e0d88fc8cddddf/src/GapicClientTrait.php#L211

Environment details

  • OS: Ubuntu
  • PHP version: 7.4
  • Package name and version: grpc v1.43

Steps to reproduce

  1. check out https://github.com/taka-oyama/grpc-bug-test.git
  2. switch branch to gax-1.11-bug
  3. run docker-compose build && docker-compose run app

Code example

Please see: https://github.com/taka-oyama/grpc-bug-test/blob/gax-1.11-bug/test.php

closed time in 2 days

taka-oyama

issue commentgoogleapis/google-cloud-php

[Spanner] updating google/gax to v1.11 throws Fatal Error in ServerStreamingCallWrapper

Thank you so much for finding this and putting together such a thorough way for us to reproduce, @taka-oyama ! It helped a lot.

After creating a fix in https://github.com/googleapis/gax-php/pull/362 and releasing a new version v1.11.2, this is now resolved (per using your repro case).

Thanks again for finding this and taking the time to log the bug and repro case. And please let us know if you encounter any other issues. Thank you!

taka-oyama

comment created time in 2 days

release googleapis/gax-php

v1.11.2

released time in 2 days

created taggoogleapis/gax-php

tagv1.11.2

Google API Extensions for PHP

created time in 2 days

pull request commentgoogleapis/gapic-generator-php

feat: add manual fix for bc-breaking changes

@noahdietz since we have the Integration tests already, which cover the same thing, should I just get rid of the tests i added to tests/Unit?

bshaffer

comment created time in 2 days

push eventgoogleapis/gapic-generator-php

Brent Shaffer

commit sha 6ba926c3b4c43c0da73db4d99e6a0ea693eae06b

fix integration tests

view details

push time in 2 days

pull request commentgoogleapis/gapic-generator-php

feat: add manual fix for bc-breaking changes

Sorry for all of the toil.

Ha! Those are the easiest instructions ever!

bshaffer

comment created time in 2 days

pull request commentgoogleapis/gapic-generator-php

feat: add manual fix for bc-breaking changes

@noahdietz any idea what the deal is with the failing bazel integration tests?

bshaffer

comment created time in 2 days

push eventgoogleapis/gapic-generator-php

Brent Shaffer

commit sha afe3f0f311b05d648fa10fdd0621d973de88fc59

readability

view details

push time in 2 days

push eventgoogleapis/gax-php

Noah Dietz

commit sha 79af83504a30cbada97531208b823d041f73abb9

fix: relax ServerStreamingCallWrapper construct param type (#362)

view details

push time in 2 days

PR merged googleapis/gax-php

fix: relax ServerStreamingCallWrapper construct param type

Relaxes the construct param for the ServerStreamingCallWrapper to be untyped, but document that it expects a Grpc\ServerStreamingCall or a Grpc\Gcp\GCPServerStreamCall.

Also updated the VERSION to 1.11.2 ahead of the release.

+6 -2

0 comment

2 changed files

noahdietz

pr closed time in 2 days

PullRequestReviewEvent
more