1 | <?php |
||
2 | /** |
||
3 | * Composer autoload |
||
4 | */ |
||
5 | require_once __DIR__ . '/../../vendor/autoload.php'; |
||
6 | |||
7 | /** |
||
8 | * Used classes |
||
9 | */ |
||
10 | use WsdlToPhp\PackageBase\AbstractSoapClientBase; |
||
11 | use Ews\EnumType\EwsExchangeVersionType; |
||
0 ignored issues
–
show
|
|||
12 | use Ews\EwsClassMap; |
||
0 ignored issues
–
show
This use statement conflicts with another class in this namespace,
EwsClassMap . Consider defining an alias.
Let?s assume that you have a directory layout like this: .
|-- OtherDir
| |-- Bar.php
| `-- Foo.php
`-- SomeDir
`-- Foo.php
and let?s assume the following content of // Bar.php
namespace OtherDir;
use SomeDir\Foo; // This now conflicts the class OtherDir\Foo
If both files PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as // Bar.php
namespace OtherDir;
use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
![]() The type
Ews\EwsClassMap was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
13 | use Ews\StructType\EwsFindItemType; |
||
0 ignored issues
–
show
The type
Ews\StructType\EwsFindItemType was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
14 | use Ews\StructType\EwsItemResponseShapeType; |
||
0 ignored issues
–
show
The type
Ews\StructType\EwsItemResponseShapeType was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
15 | use Ews\EnumType\EwsDefaultShapeNamesType; |
||
0 ignored issues
–
show
The type
Ews\EnumType\EwsDefaultShapeNamesType was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
16 | use Ews\StructType\EwsNonEmptyArrayOfBaseFolderIdsType; |
||
0 ignored issues
–
show
The type
Ews\StructType\EwsNonEmptyArrayOfBaseFolderIdsType was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
17 | use Ews\EnumType\EwsDistinguishedFolderIdNameType; |
||
0 ignored issues
–
show
The type
Ews\EnumType\EwsDistinguishedFolderIdNameType was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
18 | use Ews\EnumType\EwsItemQueryTraversalType; |
||
0 ignored issues
–
show
The type
Ews\EnumType\EwsItemQueryTraversalType was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
19 | use Ews\StructType\EwsDistinguishedFolderIdType; |
||
0 ignored issues
–
show
The type
Ews\StructType\EwsDistinguishedFolderIdType was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
20 | use Ews\StructType\EwsRequestServerVersion; |
||
0 ignored issues
–
show
The type
Ews\StructType\EwsRequestServerVersion was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
21 | |||
22 | /** |
||
23 | * Your Office 365 login |
||
24 | */ |
||
25 | define('EWS_WS_LOGIN', '***************************'); |
||
26 | /** |
||
27 | * Your Office 365 passowrd |
||
28 | */ |
||
29 | define('EWS_WS_PASSWORD', '************'); |
||
30 | |||
31 | /** |
||
32 | * Minimal options in order to instanciate the ServiceType named Get |
||
33 | */ |
||
34 | $options = array( |
||
35 | AbstractSoapClientBase::WSDL_URL => __DIR__ . '/../../wsdl/services.updated.wsdl', |
||
36 | AbstractSoapClientBase::WSDL_CLASSMAP => EwsClassMap::get(), |
||
37 | AbstractSoapClientBase::WSDL_LOGIN => EWS_WS_LOGIN, |
||
38 | AbstractSoapClientBase::WSDL_PASSWORD => EWS_WS_PASSWORD, |
||
39 | ); |
||
40 | |||
41 | /** |
||
42 | * Instanciation of the ServiceType get that gather all the operations beginnig with "get". |
||
43 | */ |
||
44 | $find = new \Ews\ServiceType\EwsFind($options); |
||
0 ignored issues
–
show
The type
Ews\ServiceType\EwsFind was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
45 | $find->setLocation('https://pod51036.outlook.com/ews/Exchange.asmx'); |
||
46 | /** |
||
47 | * Configure the SoapHeader, each header's method begins with "setSoapHeader". |
||
48 | */ |
||
49 | $find->setSoapHeaderRequestServerVersion(new EwsRequestServerVersion(EwsExchangeVersionType::VALUE_EXCHANGE_2013_SP_1)); |
||
50 | /** |
||
51 | * Send the request |
||
52 | */ |
||
53 | $itemType = new EwsFindItemType(); |
||
54 | $itemShape = new EwsItemResponseShapeType(EwsDefaultShapeNamesType::VALUE_ALL_PROPERTIES); |
||
55 | $itemType |
||
56 | ->setItemShape($itemShape) |
||
57 | ->setParentFolderIds(new EwsNonEmptyArrayOfBaseFolderIdsType(null, new EwsDistinguishedFolderIdType(EwsDistinguishedFolderIdNameType::VALUE_TASKS))) |
||
58 | ->setTraversal(EwsItemQueryTraversalType::VALUE_SHALLOW); |
||
59 | $result = $find->FindItem($itemType); |
||
60 | |||
61 | /** |
||
62 | * Debug informations provided by the utility methods |
||
63 | */ |
||
64 | if (false) { |
||
65 | echo 'XML Request: ' . $find->getLastRequest() . "\r\n"; |
||
66 | echo 'Headers Request: ' . $find->getLastRequestHeaders() . "\r\n"; |
||
67 | echo 'XML Response: ' . $find->getLastResponse() . "\r\n"; |
||
68 | echo 'Headers Response: ' . $find->getLastResponseHeaders() . "\r\n"; |
||
69 | } |
||
70 | |||
71 | if ($result !== false) { |
||
72 | /** |
||
73 | * Display the Tasks items if there is at least one: |
||
74 | * |
||
75 | * Task with subject "******************" that must be done at "2017-03-15T06:00:00Z" is "NotStarted" |
||
76 | * Task with subject "******************" that must be done at "2017-03-15T06:00:00Z" is "NotStarted" |
||
77 | * ... etc |
||
78 | */ |
||
79 | foreach($result->getResponseMessages()->getFindItemResponseMessage() as $message) { |
||
80 | $tasks = $message->getRootFolder()->getItems()->getTask(); |
||
81 | if(is_array($tasks)) { |
||
82 | foreach($tasks as $item) { |
||
83 | echo PHP_EOL . sprintf('Task with subject "%s" that must be done at "%s" is "%s"', |
||
84 | $item->getSubject(), |
||
85 | $item->getDueDate(), |
||
86 | $item->getStatus()); |
||
87 | } |
||
88 | } else { |
||
89 | echo PHP_EOL . 'No task found'; |
||
90 | } |
||
91 | echo PHP_EOL; |
||
92 | } |
||
93 | } else { |
||
94 | /** |
||
95 | * In this case, we get the \SoapFault object |
||
96 | */ |
||
97 | print_r($find->getLastErrorForMethod('\Ews\ServiceType\EwsFind::FindItem')); |
||
98 | } |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths