@@ -12,8 +12,8 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class QueryType extends Enum { |
| 14 | 14 | |
| 15 | - const ENTITIES = "ENTITIES"; |
|
| 16 | - const COUNT = "COUNT"; |
|
| 17 | - const ENTITIES_WITH_COUNT = "ENTITIES_WITH_COUNT"; |
|
| 15 | + const ENTITIES = "ENTITIES"; |
|
| 16 | + const COUNT = "COUNT"; |
|
| 17 | + const ENTITIES_WITH_COUNT = "ENTITIES_WITH_COUNT"; |
|
| 18 | 18 | |
| 19 | 19 | } |
| 20 | 20 | \ No newline at end of file |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | * of its associated entity. The returned string MUST be formatted such that it is |
| 126 | 126 | * directly usable as the value of an HTTP ETag response header. If null is returned |
| 127 | 127 | * the data service framework will assume that no ETag is associated with the stream. |
| 128 | - * |
|
| 128 | + * |
|
| 129 | 129 | * NOTE: Altering properties on the $operationContext parameter may corrupt the response |
| 130 | 130 | * from the data service. |
| 131 | 131 | * |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | $this->_verifyContentTypeOrETagModified('IDSSP::getReadStream'); |
| 107 | - } catch(ODataException $ex) { |
|
| 107 | + } catch (ODataException $ex) { |
|
| 108 | 108 | //Check for status code 304 (stream Not Modified) |
| 109 | 109 | if ($ex->getStatusCode() == 304) { |
| 110 | 110 | $eTag = $this->getStreamETag($entity, $resourceStreamInfo); |
@@ -474,9 +474,9 @@ discard block |
||
| 474 | 474 | public function getDefaultStreamEditMediaUri($mediaLinkEntryUri, $resourceStreamInfo) |
| 475 | 475 | { |
| 476 | 476 | if (is_null($resourceStreamInfo)) { |
| 477 | - return rtrim($mediaLinkEntryUri, '/') . '/' . ODataConstants::URI_VALUE_SEGMENT; |
|
| 477 | + return rtrim($mediaLinkEntryUri, '/').'/'.ODataConstants::URI_VALUE_SEGMENT; |
|
| 478 | 478 | } else { |
| 479 | - return rtrim($mediaLinkEntryUri, '/') . '/' . ltrim($resourceStreamInfo->getName(), '/'); |
|
| 479 | + return rtrim($mediaLinkEntryUri, '/').'/'.ltrim($resourceStreamInfo->getName(), '/'); |
|
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | { |
| 86 | 86 | if ($this->Id != ExpressionTokenId::IDENTIFIER) { |
| 87 | 87 | throw ODataException::createSyntaxError( |
| 88 | - 'Identifier expected at position ' . $this->Position |
|
| 88 | + 'Identifier expected at position '.$this->Position |
|
| 89 | 89 | ); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -15,92 +15,92 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * Arithmetic expression with 'add' operator |
| 17 | 17 | */ |
| 18 | - const ADD = 1; |
|
| 18 | + const ADD = 1; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * Logical expression with 'and' operator |
| 22 | 22 | */ |
| 23 | - const AND_LOGICAL = 2; |
|
| 23 | + const AND_LOGICAL = 2; |
|
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * Funcation call expression |
| 27 | 27 | * e.g. substringof('Alfreds', CompanyName) |
| 28 | 28 | */ |
| 29 | - const CALL = 3; |
|
| 29 | + const CALL = 3; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Constant expression. e.g. In the expression |
| 33 | 33 | * OrderID ne null and OrderID add 2 gt 5432 |
| 34 | 34 | * 2, null, 5432 are candicate for constant expression |
| 35 | 35 | */ |
| 36 | - const CONSTANT = 4; |
|
| 36 | + const CONSTANT = 4; |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * Arithmetic expression with 'div' operator |
| 40 | 40 | */ |
| 41 | - const DIVIDE = 5; |
|
| 41 | + const DIVIDE = 5; |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Comparison expression with 'eq' operator |
| 45 | 45 | */ |
| 46 | - const EQUAL = 6; |
|
| 46 | + const EQUAL = 6; |
|
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * Comparison expression with 'gt' operator |
| 50 | 50 | */ |
| 51 | - const GREATERTHAN = 7; |
|
| 51 | + const GREATERTHAN = 7; |
|
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * Comparison expression with 'ge' operator |
| 55 | 55 | */ |
| 56 | - const GREATERTHAN_OR_EQUAL = 8; |
|
| 56 | + const GREATERTHAN_OR_EQUAL = 8; |
|
| 57 | 57 | |
| 58 | 58 | /** |
| 59 | 59 | * Comparison expression with 'lt' operator |
| 60 | 60 | */ |
| 61 | - const LESSTHAN = 9; |
|
| 61 | + const LESSTHAN = 9; |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Comparison expression with 'le' operator |
| 65 | 65 | */ |
| 66 | - const LESSTHAN_OR_EQUAL = 10; |
|
| 66 | + const LESSTHAN_OR_EQUAL = 10; |
|
| 67 | 67 | |
| 68 | 68 | /** |
| 69 | 69 | * Arithmetic expression with 'mod' operator |
| 70 | 70 | */ |
| 71 | - const MODULO = 11; |
|
| 71 | + const MODULO = 11; |
|
| 72 | 72 | |
| 73 | 73 | /** |
| 74 | 74 | * Arithmetic expression with 'mul' operator |
| 75 | 75 | */ |
| 76 | - const MULTIPLY = 12; |
|
| 76 | + const MULTIPLY = 12; |
|
| 77 | 77 | |
| 78 | 78 | /** |
| 79 | 79 | * Unary expression with '-' operator |
| 80 | 80 | */ |
| 81 | - const NEGATE = 13; |
|
| 81 | + const NEGATE = 13; |
|
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | 84 | * Unary Logical expression with 'not' operator |
| 85 | 85 | */ |
| 86 | - const NOT_LOGICAL = 14; |
|
| 86 | + const NOT_LOGICAL = 14; |
|
| 87 | 87 | |
| 88 | 88 | /** |
| 89 | 89 | * Comparison expression with 'ne' operator |
| 90 | 90 | */ |
| 91 | - const NOTEQUAL = 15; |
|
| 91 | + const NOTEQUAL = 15; |
|
| 92 | 92 | |
| 93 | 93 | /** |
| 94 | 94 | * Logical expression with 'or' operator |
| 95 | 95 | */ |
| 96 | - const OR_LOGICAL = 16; |
|
| 96 | + const OR_LOGICAL = 16; |
|
| 97 | 97 | |
| 98 | 98 | /** |
| 99 | 99 | * Property expression. e.g. In the expression |
| 100 | 100 | * OrderID add 2 gt 5432 |
| 101 | 101 | * OrderID is candicate for PropertyAccessExpression |
| 102 | 102 | */ |
| 103 | - const PROPERTYACCESS = 17; |
|
| 103 | + const PROPERTYACCESS = 17; |
|
| 104 | 104 | |
| 105 | 105 | /** |
| 106 | 106 | * Same as property expression but for nullabilty check |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * |
| 112 | 112 | * Arithmetic expression with 'sub' operator |
| 113 | 113 | */ |
| 114 | - const SUBTRACT = 19; |
|
| 114 | + const SUBTRACT = 19; |
|
| 115 | 115 | |
| 116 | 116 | |
| 117 | 117 | } |
| 118 | 118 | \ No newline at end of file |
@@ -12,19 +12,19 @@ discard block |
||
| 12 | 12 | class FilterInfo |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * Collection of navigation properties specified in the filter |
|
| 17 | - * clause, if no navigation (resource reference) property used |
|
| 18 | - * in the clause then this property will be null. |
|
| 19 | - * |
|
| 20 | - * e.g. $filter=NaviProp1/NaviProp2/PrimitiveProp eq 12 |
|
| 21 | - * $filter=NaviPropA/NaviPropB/PrimitiveProp gt 56.3 |
|
| 22 | - * In this case array will be as follows: |
|
| 23 | - * array(array(NaviProp1, NaviProp2), array(NaviPropA, NaviPropB)) |
|
| 24 | - * |
|
| 25 | - * @var array(array(ResourceProperty))/NULL |
|
| 26 | - */ |
|
| 27 | - private $_navigationPropertiesUsedInTheFilterClause; |
|
| 15 | + /** |
|
| 16 | + * Collection of navigation properties specified in the filter |
|
| 17 | + * clause, if no navigation (resource reference) property used |
|
| 18 | + * in the clause then this property will be null. |
|
| 19 | + * |
|
| 20 | + * e.g. $filter=NaviProp1/NaviProp2/PrimitiveProp eq 12 |
|
| 21 | + * $filter=NaviPropA/NaviPropB/PrimitiveProp gt 56.3 |
|
| 22 | + * In this case array will be as follows: |
|
| 23 | + * array(array(NaviProp1, NaviProp2), array(NaviPropA, NaviPropB)) |
|
| 24 | + * |
|
| 25 | + * @var array(array(ResourceProperty))/NULL |
|
| 26 | + */ |
|
| 27 | + private $_navigationPropertiesUsedInTheFilterClause; |
|
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | /** |
@@ -47,15 +47,15 @@ discard block |
||
| 47 | 47 | */ |
| 48 | 48 | public function __construct($navigationPropertiesUsedInTheFilterClause, $filterExpAsDataSourceExp) |
| 49 | 49 | { |
| 50 | - $this->_navigationPropertiesUsedInTheFilterClause = $navigationPropertiesUsedInTheFilterClause; |
|
| 50 | + $this->_navigationPropertiesUsedInTheFilterClause = $navigationPropertiesUsedInTheFilterClause; |
|
| 51 | 51 | $this->_filterExpressionAsDataSourceExpression = $filterExpAsDataSourceExp; |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| 55 | - public function getNavigationPropertiesUsed() |
|
| 56 | - { |
|
| 57 | - return $this->_navigationPropertiesUsedInTheFilterClause; |
|
| 58 | - } |
|
| 55 | + public function getNavigationPropertiesUsed() |
|
| 56 | + { |
|
| 57 | + return $this->_navigationPropertiesUsedInTheFilterClause; |
|
| 58 | + } |
|
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -176,7 +176,7 @@ |
||
| 176 | 176 | // Also we can think about moving above urlencode to this |
| 177 | 177 | // function |
| 178 | 178 | $value = $type->convertToOData($currentObject); |
| 179 | - $nextPageLink .= $value . ', '; |
|
| 179 | + $nextPageLink .= $value.', '; |
|
| 180 | 180 | } |
| 181 | 181 | } catch (\ReflectionException $reflectionException) { |
| 182 | 182 | throw ODataException::createInternalServerError( |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @throws ODataException If any error occur while parsing orderby clause |
| 107 | 107 | */ |
| 108 | 108 | public static function parseOrderByClause( |
| 109 | - ResourceSetWrapper $resourceSetWrapper, |
|
| 109 | + ResourceSetWrapper $resourceSetWrapper, |
|
| 110 | 110 | ResourceType $resourceType, |
| 111 | 111 | $orderBy, |
| 112 | 112 | ProvidersWrapper $providerWrapper |
@@ -190,14 +190,14 @@ discard block |
||
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | if ($resourceProperty->isKindOf(ResourcePropertyKind::BAG)) { |
| 193 | - throw ODataException::createBadRequestError( |
|
| 193 | + throw ODataException::createBadRequestError( |
|
| 194 | 194 | Messages::orderByParserBagPropertyNotAllowed( |
| 195 | 195 | $resourceProperty->getName() |
| 196 | 196 | ) |
| 197 | 197 | ); |
| 198 | 198 | } else if ($resourceProperty->isKindOf(ResourcePropertyKind::PRIMITIVE)) { |
| 199 | 199 | if (!$isLastSegment) { |
| 200 | - throw ODataException::createBadRequestError( |
|
| 200 | + throw ODataException::createBadRequestError( |
|
| 201 | 201 | Messages::orderByParserPrimitiveAsIntermediateSegment( |
| 202 | 202 | $resourceProperty->getName() |
| 203 | 203 | ) |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | |
| 207 | 207 | $type = $resourceProperty->getInstanceType(); |
| 208 | 208 | if ($type instanceof Binary) { |
| 209 | - throw ODataException::createBadRequestError(Messages::orderByParserSortByBinaryPropertyNotAllowed($resourceProperty->getName())); |
|
| 209 | + throw ODataException::createBadRequestError(Messages::orderByParserSortByBinaryPropertyNotAllowed($resourceProperty->getName())); |
|
| 210 | 210 | } |
| 211 | 211 | } else if ($resourceProperty->getKind() == ResourcePropertyKind::RESOURCESET_REFERENCE |
| 212 | 212 | || $resourceProperty->getKind() == ResourcePropertyKind::RESOURCE_REFERENCE |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | $resourceSetWrapper, $resourceType, $resourceProperty |
| 220 | 220 | ); |
| 221 | 221 | if (is_null($resourceSetWrapper)) { |
| 222 | - throw ODataException::createBadRequestError( |
|
| 222 | + throw ODataException::createBadRequestError( |
|
| 223 | 223 | Messages::badRequestInvalidPropertyNameSpecified( |
| 224 | 224 | $resourceType->getFullName(), $orderBySubPathSegment |
| 225 | 225 | ) |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | if ($resourceProperty->getKind() == ResourcePropertyKind::RESOURCESET_REFERENCE) { |
| 230 | - throw ODataException::createBadRequestError( |
|
| 230 | + throw ODataException::createBadRequestError( |
|
| 231 | 231 | Messages::orderByParserResourceSetReferenceNotAllowed( |
| 232 | 232 | $resourceProperty->getName(), $resourceType->getFullName() |
| 233 | 233 | ) |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | |
| 237 | 237 | $resourceSetWrapper->checkResourceSetRightsForRead(true); |
| 238 | 238 | if ($isLastSegment) { |
| 239 | - throw ODataException::createBadRequestError( |
|
| 239 | + throw ODataException::createBadRequestError( |
|
| 240 | 240 | Messages::orderByParserSortByNavigationPropertyIsNotAllowed( |
| 241 | 241 | $resourceProperty->getName() |
| 242 | 242 | ) |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $ancestors[] = $orderBySubPathSegment; |
| 247 | 247 | } else if ($resourceProperty->isKindOf(ResourcePropertyKind::COMPLEX_TYPE)) { |
| 248 | 248 | if ($isLastSegment) { |
| 249 | - throw ODataException::createBadRequestError( |
|
| 249 | + throw ODataException::createBadRequestError( |
|
| 250 | 250 | Messages::orderByParserSortByComplexPropertyIsNotAllowed( |
| 251 | 251 | $resourceProperty->getName() |
| 252 | 252 | ) |
@@ -444,7 +444,7 @@ |
||
| 444 | 444 | $lexer->validateToken(ExpressionTokenId::DOT); |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | - $orderByPathSegments[$i][] = '*' . $identifier; |
|
| 447 | + $orderByPathSegments[$i][] = '*'.$identifier; |
|
| 448 | 448 | $lexer->nextToken(); |
| 449 | 449 | $tokenId = $lexer->getCurrentToken()->Id; |
| 450 | 450 | if ($tokenId != ExpressionTokenId::END) { |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | * or in case of any version incompatibility. |
| 32 | 32 | */ |
| 33 | 33 | public static function process(IService $service) { |
| 34 | - $host = $service->getHost(); |
|
| 34 | + $host = $service->getHost(); |
|
| 35 | 35 | $absoluteRequestUri = $host->getAbsoluteRequestUri(); |
| 36 | 36 | $absoluteServiceUri = $host->getAbsoluteServiceUri(); |
| 37 | 37 | |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | $request = new RequestDescription( |
| 50 | 50 | $segments, |
| 51 | 51 | $absoluteRequestUri, |
| 52 | - $service->getConfiguration()->getMaxDataServiceVersion(), |
|
| 53 | - $host->getRequestVersion(), |
|
| 54 | - $host->getRequestMaxVersion() |
|
| 52 | + $service->getConfiguration()->getMaxDataServiceVersion(), |
|
| 53 | + $host->getRequestVersion(), |
|
| 54 | + $host->getRequestMaxVersion() |
|
| 55 | 55 | ); |
| 56 | 56 | $kind = $request->getTargetKind(); |
| 57 | 57 | |
| 58 | - if ($kind == TargetKind::METADATA() || $kind == TargetKind::BATCH() || $kind == TargetKind::SERVICE_DIRECTORY()){ |
|
| 59 | - return $request; |
|
| 60 | - } |
|
| 58 | + if ($kind == TargetKind::METADATA() || $kind == TargetKind::BATCH() || $kind == TargetKind::SERVICE_DIRECTORY()){ |
|
| 59 | + return $request; |
|
| 60 | + } |
|
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | // http://odata/NW.svc/Employees(1)/ThumbNail_48X48/$value |
| 69 | 69 | $request->setContainerName($segments[count($segments) - 2]->getIdentifier()); |
| 70 | 70 | } else { |
| 71 | - $request->setContainerName($request->getIdentifier()); |
|
| 71 | + $request->setContainerName($request->getIdentifier()); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | if ($request->getIdentifier() === ODataConstants::URI_COUNT_SEGMENT) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | throw ODataException::createBadRequestError(Messages::configurationCountNotAccepted()); |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - $request->queryType = QueryType::COUNT(); |
|
| 79 | + $request->queryType = QueryType::COUNT(); |
|
| 80 | 80 | // use of $count requires request DataServiceVersion |
| 81 | 81 | // and MaxDataServiceVersion greater than or equal to 2.0 |
| 82 | 82 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ); |
| 56 | 56 | $kind = $request->getTargetKind(); |
| 57 | 57 | |
| 58 | - if ($kind == TargetKind::METADATA() || $kind == TargetKind::BATCH() || $kind == TargetKind::SERVICE_DIRECTORY()){ |
|
| 58 | + if ($kind == TargetKind::METADATA() || $kind == TargetKind::BATCH() || $kind == TargetKind::SERVICE_DIRECTORY()) { |
|
| 59 | 59 | return $request; |
| 60 | 60 | } |
| 61 | 61 | |
@@ -80,11 +80,11 @@ discard block |
||
| 80 | 80 | // use of $count requires request DataServiceVersion |
| 81 | 81 | // and MaxDataServiceVersion greater than or equal to 2.0 |
| 82 | 82 | |
| 83 | - $request->raiseResponseVersion( 2, 0); |
|
| 84 | - $request->raiseMinVersionRequirement(2, 0 ); |
|
| 83 | + $request->raiseResponseVersion(2, 0); |
|
| 84 | + $request->raiseMinVersionRequirement(2, 0); |
|
| 85 | 85 | |
| 86 | 86 | } else if ($request->isNamedStream()) { |
| 87 | - $request->raiseMinVersionRequirement(3, 0 ); |
|
| 87 | + $request->raiseMinVersionRequirement(3, 0); |
|
| 88 | 88 | } else if ($request->getTargetKind() == TargetKind::RESOURCE()) { |
| 89 | 89 | if (!$request->isLinkUri()) { |
| 90 | 90 | $resourceSetWrapper = $request->getTargetResourceSetWrapper(); |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | $hasBagProperty = $resourceSetWrapper->hasBagProperty($service->getProvidersWrapper()); |
| 95 | 95 | |
| 96 | 96 | if ($hasNamedStream || $hasBagProperty) { |
| 97 | - $request->raiseResponseVersion( 3, 0 ); |
|
| 97 | + $request->raiseResponseVersion(3, 0); |
|
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | } else if ($request->getTargetKind() == TargetKind::BAG() |
| 101 | 101 | ) { |
| 102 | - $request->raiseResponseVersion( 3, 0 ); |
|
| 102 | + $request->raiseResponseVersion(3, 0); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | |