Coder Social home page Coder Social logo

salesforce-client's People

Contributors

adrianwaler avatar gladhon avatar kryniol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

salesforce-client's Issues

Inconsistent docblocks and return type declarations

Sometimes a return type is specified and other times it is not.

For example, no return type here even though it has to be a bool.
https://github.com/xsolve-pl/salesforce-client/blob/master/src/Model/Account.php#L363
Btw. PHP 7 doesn't allow returning nulls when you have a return type declared.

On the other hand this has a return type, but no docblock https://github.com/xsolve-pl/salesforce-client/blob/master/src/Model/Account.php#L648

Is this by choice? I can understand no docblocks for simple methods with type declarations, but here it's pretty inconsistent.

Update GitHub hooks for Packagist

The services which link Packagist to the repository are deprecated:

This package is using the legacy GitHub service and will stop being auto-updated in early 2019. Please set up the new GitHub Hook for Packagist so that it keeps working in the future.

The repository should be updated following the Packagist documentation linked above.

Serialization config

Consider moving serialization configurations into it's own file, in my opinion it would make the code and the configuration itself more readable.

Outdated dev dependency

PHPUnit is currently fixed to version 5.5.*, should be bumped to the latest 6. When there is PHP 7.0 EOL announced we should switch to the version 7.

Cleanup the request classes

I don't think that a Get extending Update is logical. If I'm wrong please enlighten me a bit ;) If it's only about the same endpoint name I think we can afford that duplication in favor of having logically decoupled classes.

Use httplug to decouple httpClient implementation

It would be nice to integrate httplug, which standardize http client interface.

The benefit of this solution is that users does not have to adjust their http clients to implement Xsolve\SalesforceClient\Http\ClientInterface. (Most of available clients already implement HttpClient from httplug package

Unclear interface method

Please add some more information (preferably in docblock) what an implementation of https://github.com/xsolve-pl/salesforce-client/blob/master/Security/Authentication/Strategy/RegenerateStrategyInterface.php should exactly do in the getCredentials() method. I find it weird that it accepts a CredentialsInterface instance and should return an instance of the same type, should it modify its state somehow?

Besides, the support() method could be renamed to supports() to make it more English :)

Move authentication request to dedicated class

In order to have all the requests being sent to the Salesforce API stored in unified manner we could research if it's possible to move Authenticator::getRequest() logic to separate class which would implement RequestInterface like all other requests.

Comply to coding standards

We don't have any precise coding standards set yet but as default I'd use combination of http://symfony.com/doc/current/contributing/code/standards.html and PRS's. We should set up PHP CS Fixer and scan the project. First thing I found is abstract keyword which should go before the method's visibility https://github.com/xsolve-pl/salesforce-client/blob/master/Model/AbstractSObject.php but probably there will be more.

Not the top priority though so you can pick it up later on.

Error invalid_grant when doing doRequest

Hello,

I'm following the documentation but I cannot make any doRequest, all I get is the following :

In Authenticator.php line 44:
                                  
  Authentication request failed.  
                                  

In Promise.php line 127:
                                                                                                                    
  Client error: `POST https://test.salesforce.com/services/oauth2/token` resulted in a `400 Bad Request` response:  
  {"error":"invalid_grant","error_description":"authentication failure"}                                            
                                                                                                                    

In RequestException.php line 113:
                                                                                                                    
  Client error: `POST https://test.salesforce.com/services/oauth2/token` resulted in a `400 Bad Request` response:  
  {"error":"invalid_grant","error_description":"authentication failure"}                                            

Here is my code :

        $client = new GuzzleAdapter(new Client([
            'base_uri' => 'https://test.salesforce.com/',
        ]));

        $securityToken = 'XXXXXX';

        $credentials = new Credentials(
            'MY_KEY',
            'MY_SECRET',
            'password',
            [
                'username' => 'MY_ACCOUNT',
                'password' => 'MY_PASSWORD'.$securityToken,
            ]
        );

        $authenticator = new Authenticator(
            $client,
            [new PasswordGrantRegenerateStrategy()]
        );

        $tokenGenerator = new TokenGenerator(
            $credentials,
            $authenticator,
            new RequestTokenStorage()
        );

        $salesforceClient = new SalesforceClient($client, $tokenGenerator, 'v37.0');

        // print_r($salesforceClient);

        $result = $salesforceClient->doRequest(new Query('SELECT Name FROM Account'));

I do not understand where the error come from, can you help me?

composer error trying to get the correct compatable versions

I'm getting this error after fixing the guzzle6-adapter issue earlier. Not getting this to work.

Problem 1
- php-http/guzzle6-adapter is locked to version v2.0.1 and an update of this package was not requested.
- xsolve-pl/salesforce-client[1.0.0, ..., v1.0.3] require php-http/httplug ^1.1 -> satisfiable by php-http/httplug[v1.1.0].
- Conclusion: don't install php-http/httplug v1.1.0 (conflict analysis result)
- Root composer.json requires xsolve-pl/salesforce-client ^1.0 -> satisfiable by xsolve-pl/salesforce-client[1.0.0, v1.0.1, v1.0.2, v1.0.3].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

No luck with composer require xsolve-pl/salesforce-client -W either

Run CI builds on newer PHP versions

Travis CI can be configured to execute its builds on different PHP versions. As PHP7.0 slowly becomes obsolete (it's not supported since 3.12.2017 and gets only security fixes) I think we should start analysing the codebase against newer versions. Moreover, we require PHP >7.0.0 in composer.json so it would be great to have some confirmation the code works well on newer ones as well.

Mysterious prefix

We should use full name "Salesforce" instead of "S" prefix in all places. We can also try to remove that part as we have namespaces which tell what's the class' context.

Update URLs in the documentation

After migrating to the boldare namespace all the URLs in the documentation, especially the ones for badges should be updated. Moreover, the Scrutinizer project should be migrated accordingly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.