diff --git a/compiled.js b/compiled.js index c69cf171..6c8e9ae9 100644 --- a/compiled.js +++ b/compiled.js @@ -2,8 +2,46 @@ },{}],2:[function(_dereq_,module,exports){ // shim for using process in browser - var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +(function () { + try { + cachedSetTimeout = setTimeout; + } catch (e) { + cachedSetTimeout = function () { + throw new Error('setTimeout is not defined'); + } + } + try { + cachedClearTimeout = clearTimeout; + } catch (e) { + cachedClearTimeout = function () { + throw new Error('clearTimeout is not defined'); + } + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } else { + return cachedSetTimeout.call(null, fun, 0); + } +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + clearTimeout(marker); + } else { + cachedClearTimeout.call(null, marker); + } +} var queue = []; var draining = false; var currentQueue; @@ -28,7 +66,7 @@ function drainQueue() { if (draining) { return; } - var timeout = setTimeout(cleanUpNextTick); + var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; @@ -45,7 +83,7 @@ function drainQueue() { } currentQueue = null; draining = false; - clearTimeout(timeout); + runClearTimeout(timeout); } process.nextTick = function (fun) { @@ -57,7 +95,7 @@ process.nextTick = function (fun) { } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); + runTimeout(drainQueue); } }; @@ -160,7 +198,7 @@ Button.defaultProps = { ; module.exports = Button; -},{"react":475}],4:[function(_dereq_,module,exports){ +},{"react":496}],4:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -194,7 +232,7 @@ var ButtonGroup = function (_React$Component) { ; module.exports = ButtonGroup; -},{"react":475}],5:[function(_dereq_,module,exports){ +},{"react":496}],5:[function(_dereq_,module,exports){ 'use strict'; exports.Button = _dereq_('./Button'); @@ -213,7 +251,7 @@ function Card(props) { } module.exports = Card; -},{"react":475}],7:[function(_dereq_,module,exports){ +},{"react":496}],7:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -238,7 +276,7 @@ CardContent.propTypes = { module.exports = CardContent; -},{"react":475}],8:[function(_dereq_,module,exports){ +},{"react":496}],8:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -252,7 +290,7 @@ function CardControl(props) { } module.exports = CardControl; -},{"react":475}],9:[function(_dereq_,module,exports){ +},{"react":496}],9:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -360,7 +398,7 @@ CardDrawers.propTypes = { module.exports = CardDrawers; -},{"./CardSection":12,"./CardToolbar":13,"./CardToolbarLink":14,"react":475}],10:[function(_dereq_,module,exports){ +},{"./CardSection":12,"./CardToolbar":13,"./CardToolbarLink":14,"react":496}],10:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -370,7 +408,7 @@ function CardLoadingText(props) { } module.exports = CardLoadingText; -},{"react":475}],11:[function(_dereq_,module,exports){ +},{"react":496}],11:[function(_dereq_,module,exports){ 'use strict'; var React = _dereq_('react'); @@ -399,7 +437,7 @@ CardMessages.propTypes = { module.exports = CardMessages; -},{"react":475}],12:[function(_dereq_,module,exports){ +},{"react":496}],12:[function(_dereq_,module,exports){ 'use strict'; var React = _dereq_('react'); @@ -422,7 +460,7 @@ CardSection.defaultProps = { module.exports = CardSection; -},{"react":475}],13:[function(_dereq_,module,exports){ +},{"react":496}],13:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -452,7 +490,7 @@ CardToolbar.propTypes = { module.exports = CardToolbar; -},{"react":475}],14:[function(_dereq_,module,exports){ +},{"react":496}],14:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -508,7 +546,7 @@ CardToolbarLink.propTypes = { module.exports = CardToolbarLink; -},{"cf-component-link":17,"react":475}],15:[function(_dereq_,module,exports){ +},{"cf-component-link":17,"react":496}],15:[function(_dereq_,module,exports){ 'use strict'; exports.Card = _dereq_('./Card'); @@ -618,7 +656,7 @@ Link.defaultProps = { module.exports = Link; -},{"cf-util-route-handler":18,"react":475}],17:[function(_dereq_,module,exports){ +},{"cf-util-route-handler":18,"react":496}],17:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./Link'); @@ -721,7 +759,7 @@ Checkbox.propTypes = { module.exports = Checkbox; -},{"react":475}],21:[function(_dereq_,module,exports){ +},{"react":496}],21:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -798,7 +836,7 @@ CheckboxGroup.propTypes = { module.exports = CheckboxGroup; -},{"./Checkbox":20,"lodash/includes":36,"react":475}],22:[function(_dereq_,module,exports){ +},{"./Checkbox":20,"lodash/includes":38,"react":496}],22:[function(_dereq_,module,exports){ 'use strict'; exports.Checkbox = _dereq_('./Checkbox'); @@ -827,6 +865,32 @@ function arrayMap(array, iteratee) { module.exports = arrayMap; },{}],24:[function(_dereq_,module,exports){ +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to search. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +module.exports = baseFindIndex; + +},{}],25:[function(_dereq_,module,exports){ var getPrototype = _dereq_('./_getPrototype'); /** Used for built-in method references. */ @@ -854,8 +918,9 @@ function baseHas(object, key) { module.exports = baseHas; -},{"./_getPrototype":31}],25:[function(_dereq_,module,exports){ -var indexOfNaN = _dereq_('./_indexOfNaN'); +},{"./_getPrototype":33}],26:[function(_dereq_,module,exports){ +var baseFindIndex = _dereq_('./_baseFindIndex'), + baseIsNaN = _dereq_('./_baseIsNaN'); /** * The base implementation of `_.indexOf` without `fromIndex` bounds checks. @@ -868,7 +933,7 @@ var indexOfNaN = _dereq_('./_indexOfNaN'); */ function baseIndexOf(array, value, fromIndex) { if (value !== value) { - return indexOfNaN(array, fromIndex); + return baseFindIndex(array, baseIsNaN, fromIndex); } var index = fromIndex - 1, length = array.length; @@ -883,7 +948,23 @@ function baseIndexOf(array, value, fromIndex) { module.exports = baseIndexOf; -},{"./_indexOfNaN":33}],26:[function(_dereq_,module,exports){ +},{"./_baseFindIndex":24,"./_baseIsNaN":27}],27:[function(_dereq_,module,exports){ +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +module.exports = baseIsNaN; + +},{}],28:[function(_dereq_,module,exports){ +var overArg = _dereq_('./_overArg'); + /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeKeys = Object.keys; @@ -895,13 +976,11 @@ var nativeKeys = Object.keys; * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ -function baseKeys(object) { - return nativeKeys(Object(object)); -} +var baseKeys = overArg(nativeKeys, Object); module.exports = baseKeys; -},{}],27:[function(_dereq_,module,exports){ +},{"./_overArg":37}],29:[function(_dereq_,module,exports){ /** * The base implementation of `_.property` without support for deep paths. * @@ -917,7 +996,7 @@ function baseProperty(key) { module.exports = baseProperty; -},{}],28:[function(_dereq_,module,exports){ +},{}],30:[function(_dereq_,module,exports){ /** * The base implementation of `_.times` without support for iteratee shorthands * or max array length checks. @@ -939,7 +1018,7 @@ function baseTimes(n, iteratee) { module.exports = baseTimes; -},{}],29:[function(_dereq_,module,exports){ +},{}],31:[function(_dereq_,module,exports){ var arrayMap = _dereq_('./_arrayMap'); /** @@ -960,7 +1039,7 @@ function baseValues(object, props) { module.exports = baseValues; -},{"./_arrayMap":23}],30:[function(_dereq_,module,exports){ +},{"./_arrayMap":23}],32:[function(_dereq_,module,exports){ var baseProperty = _dereq_('./_baseProperty'); /** @@ -978,7 +1057,9 @@ var getLength = baseProperty('length'); module.exports = getLength; -},{"./_baseProperty":27}],31:[function(_dereq_,module,exports){ +},{"./_baseProperty":29}],33:[function(_dereq_,module,exports){ +var overArg = _dereq_('./_overArg'); + /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeGetPrototype = Object.getPrototypeOf; @@ -989,13 +1070,11 @@ var nativeGetPrototype = Object.getPrototypeOf; * @param {*} value The value to query. * @returns {null|Object} Returns the `[[Prototype]]`. */ -function getPrototype(value) { - return nativeGetPrototype(Object(value)); -} +var getPrototype = overArg(nativeGetPrototype, Object); module.exports = getPrototype; -},{}],32:[function(_dereq_,module,exports){ +},{"./_overArg":37}],34:[function(_dereq_,module,exports){ var baseTimes = _dereq_('./_baseTimes'), isArguments = _dereq_('./isArguments'), isArray = _dereq_('./isArray'), @@ -1021,32 +1100,7 @@ function indexKeys(object) { module.exports = indexKeys; -},{"./_baseTimes":28,"./isArguments":37,"./isArray":38,"./isLength":42,"./isString":45}],33:[function(_dereq_,module,exports){ -/** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ -function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; -} - -module.exports = indexOfNaN; - -},{}],34:[function(_dereq_,module,exports){ +},{"./_baseTimes":30,"./isArguments":39,"./isArray":40,"./isLength":44,"./isString":47}],35:[function(_dereq_,module,exports){ /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; @@ -1070,7 +1124,7 @@ function isIndex(value, length) { module.exports = isIndex; -},{}],35:[function(_dereq_,module,exports){ +},{}],36:[function(_dereq_,module,exports){ /** Used for built-in method references. */ var objectProto = Object.prototype; @@ -1090,7 +1144,24 @@ function isPrototype(value) { module.exports = isPrototype; -},{}],36:[function(_dereq_,module,exports){ +},{}],37:[function(_dereq_,module,exports){ +/** + * Creates a function that invokes `func` with its first argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +module.exports = overArg; + +},{}],38:[function(_dereq_,module,exports){ var baseIndexOf = _dereq_('./_baseIndexOf'), isArrayLike = _dereq_('./isArrayLike'), isString = _dereq_('./isString'), @@ -1124,10 +1195,10 @@ var nativeMax = Math.max; * _.includes([1, 2, 3], 1, 2); * // => false * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * - * _.includes('pebbles', 'eb'); + * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { @@ -1145,7 +1216,7 @@ function includes(collection, value, fromIndex, guard) { module.exports = includes; -},{"./_baseIndexOf":25,"./isArrayLike":39,"./isString":45,"./toInteger":49,"./values":51}],37:[function(_dereq_,module,exports){ +},{"./_baseIndexOf":26,"./isArrayLike":41,"./isString":47,"./toInteger":51,"./values":53}],39:[function(_dereq_,module,exports){ var isArrayLikeObject = _dereq_('./isArrayLikeObject'); /** `Object#toString` result references. */ @@ -1175,7 +1246,7 @@ var propertyIsEnumerable = objectProto.propertyIsEnumerable; * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, + * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * @@ -1193,18 +1264,16 @@ function isArguments(value) { module.exports = isArguments; -},{"./isArrayLikeObject":40}],38:[function(_dereq_,module,exports){ +},{"./isArrayLikeObject":42}],40:[function(_dereq_,module,exports){ /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 - * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); @@ -1223,7 +1292,7 @@ var isArray = Array.isArray; module.exports = isArray; -},{}],39:[function(_dereq_,module,exports){ +},{}],41:[function(_dereq_,module,exports){ var getLength = _dereq_('./_getLength'), isFunction = _dereq_('./isFunction'), isLength = _dereq_('./isLength'); @@ -1259,7 +1328,7 @@ function isArrayLike(value) { module.exports = isArrayLike; -},{"./_getLength":30,"./isFunction":41,"./isLength":42}],40:[function(_dereq_,module,exports){ +},{"./_getLength":32,"./isFunction":43,"./isLength":44}],42:[function(_dereq_,module,exports){ var isArrayLike = _dereq_('./isArrayLike'), isObjectLike = _dereq_('./isObjectLike'); @@ -1294,7 +1363,7 @@ function isArrayLikeObject(value) { module.exports = isArrayLikeObject; -},{"./isArrayLike":39,"./isObjectLike":44}],41:[function(_dereq_,module,exports){ +},{"./isArrayLike":41,"./isObjectLike":46}],43:[function(_dereq_,module,exports){ var isObject = _dereq_('./isObject'); /** `Object#toString` result references. */ @@ -1319,8 +1388,7 @@ var objectToString = objectProto.toString; * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -1339,7 +1407,7 @@ function isFunction(value) { module.exports = isFunction; -},{"./isObject":43}],42:[function(_dereq_,module,exports){ +},{"./isObject":45}],44:[function(_dereq_,module,exports){ /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; @@ -1377,7 +1445,7 @@ function isLength(value) { module.exports = isLength; -},{}],43:[function(_dereq_,module,exports){ +},{}],45:[function(_dereq_,module,exports){ /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) @@ -1410,7 +1478,7 @@ function isObject(value) { module.exports = isObject; -},{}],44:[function(_dereq_,module,exports){ +},{}],46:[function(_dereq_,module,exports){ /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". @@ -1441,7 +1509,7 @@ function isObjectLike(value) { module.exports = isObjectLike; -},{}],45:[function(_dereq_,module,exports){ +},{}],47:[function(_dereq_,module,exports){ var isArray = _dereq_('./isArray'), isObjectLike = _dereq_('./isObjectLike'); @@ -1466,8 +1534,7 @@ var objectToString = objectProto.toString; * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); @@ -1483,7 +1550,7 @@ function isString(value) { module.exports = isString; -},{"./isArray":38,"./isObjectLike":44}],46:[function(_dereq_,module,exports){ +},{"./isArray":40,"./isObjectLike":46}],48:[function(_dereq_,module,exports){ var isObjectLike = _dereq_('./isObjectLike'); /** `Object#toString` result references. */ @@ -1507,8 +1574,7 @@ var objectToString = objectProto.toString; * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); @@ -1524,7 +1590,7 @@ function isSymbol(value) { module.exports = isSymbol; -},{"./isObjectLike":44}],47:[function(_dereq_,module,exports){ +},{"./isObjectLike":46}],49:[function(_dereq_,module,exports){ var baseHas = _dereq_('./_baseHas'), baseKeys = _dereq_('./_baseKeys'), indexKeys = _dereq_('./_indexKeys'), @@ -1582,7 +1648,7 @@ function keys(object) { module.exports = keys; -},{"./_baseHas":24,"./_baseKeys":26,"./_indexKeys":32,"./_isIndex":34,"./_isPrototype":35,"./isArrayLike":39}],48:[function(_dereq_,module,exports){ +},{"./_baseHas":25,"./_baseKeys":28,"./_indexKeys":34,"./_isIndex":35,"./_isPrototype":36,"./isArrayLike":41}],50:[function(_dereq_,module,exports){ var toNumber = _dereq_('./toNumber'); /** Used as references for various `Number` constants. */ @@ -1626,7 +1692,7 @@ function toFinite(value) { module.exports = toFinite; -},{"./toNumber":50}],49:[function(_dereq_,module,exports){ +},{"./toNumber":52}],51:[function(_dereq_,module,exports){ var toFinite = _dereq_('./toFinite'); /** @@ -1664,7 +1730,7 @@ function toInteger(value) { module.exports = toInteger; -},{"./toFinite":48}],50:[function(_dereq_,module,exports){ +},{"./toFinite":50}],52:[function(_dereq_,module,exports){ var isFunction = _dereq_('./isFunction'), isObject = _dereq_('./isObject'), isSymbol = _dereq_('./isSymbol'); @@ -1733,7 +1799,7 @@ function toNumber(value) { module.exports = toNumber; -},{"./isFunction":41,"./isObject":43,"./isSymbol":46}],51:[function(_dereq_,module,exports){ +},{"./isFunction":43,"./isObject":45,"./isSymbol":48}],53:[function(_dereq_,module,exports){ var baseValues = _dereq_('./_baseValues'), keys = _dereq_('./keys'); @@ -1769,7 +1835,320 @@ function values(object) { module.exports = values; -},{"./_baseValues":29,"./keys":47}],52:[function(_dereq_,module,exports){ +},{"./_baseValues":31,"./keys":49}],54:[function(_dereq_,module,exports){ +(function (global){ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var React = _dereq_('react'); +var PropTypes = React.PropTypes; + +var DropdownRegistry = _dereq_('./DropdownRegistry'); + +var _require = _dereq_('exenv'); + +var canUseDOM = _require.canUseDOM; + +var Dropdown = function (_React$Component) { + _inherits(Dropdown, _React$Component); + + Dropdown.prototype.getChildContext = function getChildContext() { + return { + dropdownRegistry: this.dropdownRegistry + }; + }; + + function Dropdown(props, context) { + _classCallCheck(this, Dropdown); + + var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); + + _this.handleDocumentKeydown = function (event) { + var keyCode = event.keyCode; + + if (keyCode === 40) { + // down + event.preventDefault(); + _this.dropdownRegistry.focusNext(); + } else if (keyCode === 38) { + // up + event.preventDefault(); + _this.dropdownRegistry.focusPrev(); + } else if (keyCode === 27) { + // esc + _this.props.onClose(); + } + }; + + _this.handleDocumentClick = function (event) { + _this.props.onClose(); + }; + + _this.dropdownRegistry = new DropdownRegistry(); + return _this; + } + + Dropdown.prototype.componentDidMount = function componentDidMount() { + if (canUseDOM) { + global.document.addEventListener('keydown', this.handleDocumentKeydown); + global.document.addEventListener('click', this.handleDocumentClick); + } + }; + + Dropdown.prototype.componentWillUnmount = function componentWillUnmount() { + if (canUseDOM) { + global.document.removeEventListener('keydown', this.handleDocumentKeydown); + global.document.removeEventListener('click', this.handleDocumentClick); + } + }; + + Dropdown.prototype.render = function render() { + return React.createElement( + 'ul', + { role: 'menu', className: 'cf-dropdown cf-dropdown--' + this.props.align }, + this.props.children + ); + }; + + return Dropdown; +}(React.Component); + +Dropdown.propTypes = { + onClose: PropTypes.func.isRequired, + align: PropTypes.oneOf(['left', 'right']) +}; +Dropdown.defaultProps = { + align: 'left' +}; +Dropdown.childContextTypes = { + dropdownRegistry: PropTypes.instanceOf(DropdownRegistry).isRequired +}; + + +module.exports = Dropdown; +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +},{"./DropdownRegistry":56,"exenv":63,"react":496}],55:[function(_dereq_,module,exports){ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var React = _dereq_('react'); +var PropTypes = React.PropTypes; + +var _require = _dereq_('react-dom'); + +var findDOMNode = _require.findDOMNode; + +var Link = _dereq_('cf-component-link'); +var DropdownRegistry = _dereq_('./DropdownRegistry'); + +var DropdownLink = function (_React$Component) { + _inherits(DropdownLink, _React$Component); + + function DropdownLink(props, context) { + _classCallCheck(this, DropdownLink); + + if (!props.to && !props.onClick) { + throw new Error(' requires either a `to` or `onClick` prop'); + } + + var _this = _possibleConstructorReturn(this, _React$Component.call(this, props, context)); + + _this.handleLinkFocus = function (e) { + _this.dropdownRegistry.setFocusedChild(_this); + }; + + _this.handleLinkBlur = function (e) { + _this.dropdownRegistry.removeFocusedChild(); + }; + + _this.dropdownRegistry = context.dropdownRegistry; + return _this; + } + + DropdownLink.prototype.componentWillMount = function componentWillMount() { + this.dropdownRegistry.addChild(this); + }; + + DropdownLink.prototype.componentWillUnmount = function componentWillUnmount() { + this.dropdownRegistry.removeChild(this); + }; + + DropdownLink.prototype.focus = function focus() { + findDOMNode(this.refs.link).focus(); + }; + + DropdownLink.prototype.render = function render() { + return React.createElement( + 'li', + { className: 'cf-dropdown__link', role: 'menuitem' }, + React.createElement( + Link, + { ref: 'link', + to: this.props.to, + onClick: this.props.onClick, + onFocus: this.handleLinkFocus, + onBlur: this.handleLinkBlur }, + this.props.children + ) + ); + }; + + return DropdownLink; +}(React.Component); + +DropdownLink.propTypes = { + to: PropTypes.string, + onClick: PropTypes.func +}; +DropdownLink.contextTypes = { + dropdownRegistry: PropTypes.instanceOf(DropdownRegistry).isRequired +}; + + +module.exports = DropdownLink; +},{"./DropdownRegistry":56,"cf-component-link":60,"react":496,"react-dom":259}],56:[function(_dereq_,module,exports){ +"use strict"; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var DropdownRegistry = function () { + function DropdownRegistry() { + _classCallCheck(this, DropdownRegistry); + + this._links = []; + this._currentFocusIndex = -1; + } + + DropdownRegistry.prototype.addChild = function addChild(child) { + this._links.push(child); + }; + + DropdownRegistry.prototype.removeChild = function removeChild(child) { + this._links.splice(this._links.indexOf(child), 1); + }; + + DropdownRegistry.prototype._focusChildAt = function _focusChildAt(index) { + if (this._links[index]) { + this._links[index].focus(); + } + }; + + DropdownRegistry.prototype.focusNext = function focusNext() { + this._focusChildAt(this._currentFocusIndex + 1); + }; + + DropdownRegistry.prototype.focusPrev = function focusPrev() { + this._focusChildAt(this._currentFocusIndex - 1); + }; + + DropdownRegistry.prototype.setFocusedChild = function setFocusedChild(child) { + this._currentFocusIndex = this._links.indexOf(child); + }; + + DropdownRegistry.prototype.removeFocusedChild = function removeFocusedChild(child) { + this._currentFocusIndex = -1; + }; + + return DropdownRegistry; +}(); + +module.exports = DropdownRegistry; +},{}],57:[function(_dereq_,module,exports){ +"use strict"; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var React = _dereq_('react'); + +var DropdownSeparator = function (_React$Component) { + _inherits(DropdownSeparator, _React$Component); + + function DropdownSeparator() { + _classCallCheck(this, DropdownSeparator); + + return _possibleConstructorReturn(this, _React$Component.apply(this, arguments)); + } + + DropdownSeparator.prototype.render = function render() { + return React.createElement("div", { className: "cf-dropdown__separator", role: "separator" }); + }; + + return DropdownSeparator; +}(React.Component); + +module.exports = DropdownSeparator; +},{"react":496}],58:[function(_dereq_,module,exports){ +'use strict'; + +exports.Dropdown = _dereq_('./Dropdown'); +exports.DropdownLink = _dereq_('./DropdownLink'); +exports.DropdownSeparator = _dereq_('./DropdownSeparator'); +},{"./Dropdown":54,"./DropdownLink":55,"./DropdownSeparator":57}],59:[function(_dereq_,module,exports){ +arguments[4][16][0].apply(exports,arguments) +},{"cf-util-route-handler":61,"dup":16,"react":496}],60:[function(_dereq_,module,exports){ +arguments[4][17][0].apply(exports,arguments) +},{"./Link":59,"dup":17}],61:[function(_dereq_,module,exports){ +arguments[4][18][0].apply(exports,arguments) +},{"./routeHandler":62,"dup":18}],62:[function(_dereq_,module,exports){ +arguments[4][19][0].apply(exports,arguments) +},{"dup":19}],63:[function(_dereq_,module,exports){ +/*! + Copyright (c) 2015 Jed Watson. + Based on code that is Copyright 2013-2015, Facebook, Inc. + All rights reserved. +*/ +/* global define */ + +(function () { + 'use strict'; + + var canUseDOM = !!( + typeof window !== 'undefined' && + window.document && + window.document.createElement + ); + + var ExecutionEnvironment = { + + canUseDOM: canUseDOM, + + canUseWorkers: typeof Worker !== 'undefined', + + canUseEventListeners: + canUseDOM && !!(window.addEventListener || window.attachEvent), + + canUseViewport: canUseDOM && !!window.screen + + }; + + if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { + define(function () { + return ExecutionEnvironment; + }); + } else if (typeof module !== 'undefined' && module.exports) { + module.exports = ExecutionEnvironment; + } else { + window.ExecutionEnvironment = ExecutionEnvironment; + } + +}()); + +},{}],64:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1805,7 +2184,7 @@ Heading.propTypes = { module.exports = Heading; -},{"react":475}],53:[function(_dereq_,module,exports){ +},{"react":496}],65:[function(_dereq_,module,exports){ "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1837,12 +2216,12 @@ var HeadingCaption = function (_React$Component) { }(React.Component); module.exports = HeadingCaption; -},{"react":475}],54:[function(_dereq_,module,exports){ +},{"react":496}],66:[function(_dereq_,module,exports){ 'use strict'; exports.Heading = _dereq_('./Heading'); exports.HeadingCaption = _dereq_('./HeadingCaption'); -},{"./Heading":52,"./HeadingCaption":53}],55:[function(_dereq_,module,exports){ +},{"./Heading":64,"./HeadingCaption":65}],67:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1881,7 +2260,7 @@ LayoutColumn.propTypes = { module.exports = LayoutColumn; -},{"react":475}],56:[function(_dereq_,module,exports){ +},{"react":496}],68:[function(_dereq_,module,exports){ "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1913,7 +2292,7 @@ var LayoutContainer = function (_React$Component) { }(React.Component); module.exports = LayoutContainer; -},{"react":475}],57:[function(_dereq_,module,exports){ +},{"react":496}],69:[function(_dereq_,module,exports){ "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -1945,13 +2324,13 @@ var LayoutRow = function (_React$Component) { }(React.Component); module.exports = LayoutRow; -},{"react":475}],58:[function(_dereq_,module,exports){ +},{"react":496}],70:[function(_dereq_,module,exports){ 'use strict'; exports.LayoutContainer = _dereq_('./LayoutContainer'); exports.LayoutRow = _dereq_('./LayoutRow'); exports.LayoutColumn = _dereq_('./LayoutColumn'); -},{"./LayoutColumn":55,"./LayoutContainer":56,"./LayoutRow":57}],59:[function(_dereq_,module,exports){ +},{"./LayoutColumn":67,"./LayoutContainer":68,"./LayoutRow":69}],71:[function(_dereq_,module,exports){ 'use strict'; function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } @@ -2050,9 +2429,9 @@ Link.defaultProps = { }; module.exports = Link; -},{"cf-util-route-handler":61,"react":475}],60:[function(_dereq_,module,exports){ +},{"cf-util-route-handler":73,"react":496}],72:[function(_dereq_,module,exports){ arguments[4][17][0].apply(exports,arguments) -},{"./Link":59,"dup":17}],61:[function(_dereq_,module,exports){ +},{"./Link":71,"dup":17}],73:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -2075,7 +2454,7 @@ function routeTo(url) { handler(url); } -},{}],62:[function(_dereq_,module,exports){ +},{}],74:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2126,7 +2505,7 @@ List.defaultProps = { module.exports = List; -},{"react":475}],63:[function(_dereq_,module,exports){ +},{"react":496}],75:[function(_dereq_,module,exports){ "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2158,12 +2537,12 @@ var ListItem = function (_React$Component) { }(React.Component); module.exports = ListItem; -},{"react":475}],64:[function(_dereq_,module,exports){ +},{"react":496}],76:[function(_dereq_,module,exports){ 'use strict'; exports.List = _dereq_('./List'); exports.ListItem = _dereq_('./ListItem'); -},{"./List":62,"./ListItem":63}],65:[function(_dereq_,module,exports){ +},{"./List":74,"./ListItem":75}],77:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2250,7 +2629,7 @@ Modal.defaultProps = { }; module.exports = Modal; -},{"react":475,"react-addons-css-transition-group":235,"react-gateway":244,"react-modal2":74}],66:[function(_dereq_,module,exports){ +},{"react":496,"react-addons-css-transition-group":255,"react-gateway":264,"react-modal2":86}],78:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -2264,7 +2643,7 @@ function ModalActions(props) { } module.exports = ModalActions; -},{"react":475}],67:[function(_dereq_,module,exports){ +},{"react":496}],79:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -2278,7 +2657,7 @@ function ModalBody(props) { } module.exports = ModalBody; -},{"react":475}],68:[function(_dereq_,module,exports){ +},{"react":496}],80:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -2293,7 +2672,7 @@ ModalClose.propTypes = { }; module.exports = ModalClose; -},{"react":475}],69:[function(_dereq_,module,exports){ +},{"react":496}],81:[function(_dereq_,module,exports){ 'use strict'; var React = _dereq_('react'); @@ -2321,7 +2700,7 @@ ModalFooter.defaultProps = { }; module.exports = ModalFooter; -},{"react":475}],70:[function(_dereq_,module,exports){ +},{"react":496}],82:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -2335,7 +2714,7 @@ function ModalHeader(props) { } module.exports = ModalHeader; -},{"react":475}],71:[function(_dereq_,module,exports){ +},{"react":496}],83:[function(_dereq_,module,exports){ "use strict"; var React = _dereq_('react'); @@ -2349,7 +2728,7 @@ function ModalTitle(props) { } module.exports = ModalTitle; -},{"react":475}],72:[function(_dereq_,module,exports){ +},{"react":496}],84:[function(_dereq_,module,exports){ 'use strict'; exports.Modal = _dereq_('./Modal'); @@ -2359,7 +2738,7 @@ exports.ModalClose = _dereq_('./ModalClose'); exports.ModalFooter = _dereq_('./ModalFooter'); exports.ModalHeader = _dereq_('./ModalHeader'); exports.ModalTitle = _dereq_('./ModalTitle'); -},{"./Modal":65,"./ModalActions":66,"./ModalBody":67,"./ModalClose":68,"./ModalFooter":69,"./ModalHeader":70,"./ModalTitle":71}],73:[function(_dereq_,module,exports){ +},{"./Modal":77,"./ModalActions":78,"./ModalBody":79,"./ModalClose":80,"./ModalFooter":81,"./ModalHeader":82,"./ModalTitle":83}],85:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -2400,7 +2779,7 @@ function resetFocus(applicationElement) { _a11yFocusStore2.default.restoreFocus(); } -var ReactModal2 = (function (_React$Component) { +var ReactModal2 = function (_React$Component) { _inherits(ReactModal2, _React$Component); function ReactModal2() { @@ -2463,7 +2842,7 @@ var ReactModal2 = (function (_React$Component) { }; return ReactModal2; -})(_react2.default.Component); +}(_react2.default.Component); ReactModal2.propTypes = { onClose: _react2.default.PropTypes.func.isRequired, @@ -2482,7 +2861,7 @@ ReactModal2.defaultProps = { closeOnBackdropClick: true }; exports.default = ReactModal2; -},{"a11y-focus-scope":75,"a11y-focus-store":78,"exenv":79,"react":475}],74:[function(_dereq_,module,exports){ +},{"a11y-focus-scope":87,"a11y-focus-store":90,"exenv":91,"react":496}],86:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -2495,7 +2874,7 @@ var _Modal2 = _interopRequireDefault(_Modal); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } exports.default = _Modal2.default; -},{"./Modal":73}],75:[function(_dereq_,module,exports){ +},{"./Modal":85}],87:[function(_dereq_,module,exports){ 'use strict'; var tabbable = _dereq_('tabbable'); @@ -2541,7 +2920,7 @@ exports.unscopeFocus = function() { teardownFn = null; }; -},{"focusin":76,"tabbable":77}],76:[function(_dereq_,module,exports){ +},{"focusin":88,"tabbable":89}],88:[function(_dereq_,module,exports){ /* from https://gist.github.com/nuxodin/9250e56a3ce6c0446efa */ function polyfill () { @@ -2580,13 +2959,13 @@ module.exports = { polyfill: polyfill } -},{}],77:[function(_dereq_,module,exports){ +},{}],89:[function(_dereq_,module,exports){ module.exports = function(el) { var basicTabbables = []; var orderedTabbables = []; + var isHidden = createIsHidden(); - var candidateNodelist = el.querySelectorAll('input, select, a, textarea, button, [tabindex]'); - var candidates = Array.prototype.slice.call(candidateNodelist); + var candidates = el.querySelectorAll('input, select, a[href], textarea, button, [tabindex]'); var candidate, candidateIndex; for (var i = 0, l = candidates.length; i < l; i++) { @@ -2596,7 +2975,6 @@ module.exports = function(el) { if ( candidateIndex < 0 || (candidate.tagName === 'INPUT' && candidate.type === 'hidden') - || (candidate.tagName === 'A' && !candidate.href && !candidate.tabIndex) || candidate.disabled || isHidden(candidate) ) { @@ -2626,33 +3004,34 @@ module.exports = function(el) { return tabbableNodes; } -var nodeCache = {}; -var nodeCacheIndex = 1; -function isHidden(node) { - if (node === document.documentElement) { - return false; - } +function createIsHidden() { + // Node cache must be refreshed on every check, in case + // the content of the element has changed + var nodeCache = []; - if (node.tabbableCacheIndex) { - return nodeCache[node.tabbableCacheIndex]; - } + return function isHidden(node) { + if (node === document.documentElement) return false; - var result = false; - var style = window.getComputedStyle(node); - if (style.visibility === 'hidden' || style.display === 'none') { - result = true; - } else if (node.parentNode) { - result = isHidden(node.parentNode); - } + // Find the cached node (Array.prototype.find not available in IE9) + for (var i = 0, length = nodeCache.length; i < length; i++) { + if (nodeCache[i][0] === node) return nodeCache[i][1]; + } + + var result = false; + var style = window.getComputedStyle(node); + if (style.visibility === 'hidden' || style.display === 'none') { + result = true; + } else if (node.parentNode) { + result = isHidden(node.parentNode); + } - node.tabbableCacheIndex = nodeCacheIndex; - nodeCache[node.tabbableCacheIndex] = result; - nodeCacheIndex++; + nodeCache.push([node, result]); - return result; + return result; + } } -},{}],78:[function(_dereq_,module,exports){ +},{}],90:[function(_dereq_,module,exports){ 'use strict'; var storedFocusElement; @@ -2671,49 +3050,9 @@ exports.restoreFocus = function() { storedFocusElement = null; }; -},{}],79:[function(_dereq_,module,exports){ -/*! - Copyright (c) 2015 Jed Watson. - Based on code that is Copyright 2013-2015, Facebook, Inc. - All rights reserved. -*/ -/* global define */ - -(function () { - 'use strict'; - - var canUseDOM = !!( - typeof window !== 'undefined' && - window.document && - window.document.createElement - ); - - var ExecutionEnvironment = { - - canUseDOM: canUseDOM, - - canUseWorkers: typeof Worker !== 'undefined', - - canUseEventListeners: - canUseDOM && !!(window.addEventListener || window.attachEvent), - - canUseViewport: canUseDOM && !!window.screen - - }; - - if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) { - define(function () { - return ExecutionEnvironment; - }); - } else if (typeof module !== 'undefined' && module.exports) { - module.exports = ExecutionEnvironment; - } else { - window.ExecutionEnvironment = ExecutionEnvironment; - } - -}()); - -},{}],80:[function(_dereq_,module,exports){ +},{}],91:[function(_dereq_,module,exports){ +arguments[4][63][0].apply(exports,arguments) +},{"dup":63}],92:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2780,7 +3119,7 @@ Radio.propTypes = { module.exports = Radio; -},{"react":475}],81:[function(_dereq_,module,exports){ +},{"react":496}],93:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2836,12 +3175,12 @@ RadioGroup.propTypes = { module.exports = RadioGroup; -},{"./Radio":80,"react":475}],82:[function(_dereq_,module,exports){ +},{"./Radio":92,"react":496}],94:[function(_dereq_,module,exports){ 'use strict'; exports.Radio = _dereq_('./Radio'); exports.RadioGroup = _dereq_('./RadioGroup'); -},{"./Radio":80,"./RadioGroup":81}],83:[function(_dereq_,module,exports){ +},{"./Radio":92,"./RadioGroup":93}],95:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -2917,11 +3256,11 @@ Select.defaultProps = { ; module.exports = Select; -},{"react":475,"react-select":86}],84:[function(_dereq_,module,exports){ +},{"react":496,"react-select":98}],96:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./Select'); -},{"./Select":83}],85:[function(_dereq_,module,exports){ +},{"./Select":95}],97:[function(_dereq_,module,exports){ 'use strict'; var React = _dereq_('react'); @@ -2986,7 +3325,7 @@ var Option = React.createClass({ }); module.exports = Option; -},{"classnames":89,"react":475}],86:[function(_dereq_,module,exports){ +},{"classnames":101,"react":496}],98:[function(_dereq_,module,exports){ /* disable some rules until we refactor more completely; fixing them now would cause conflicts with some open PRs unnecessarily. */ /* eslint react/jsx-sort-prop-types: 0, react/sort-comp: 0, react/prop-types: 0 */ @@ -3934,7 +4273,7 @@ var Select = React.createClass({ }); module.exports = Select; -},{"./Option":85,"./SingleValue":87,"./Value":88,"classnames":89,"react":475,"react-dom":239,"react-input-autosize":90}],87:[function(_dereq_,module,exports){ +},{"./Option":97,"./SingleValue":99,"./Value":100,"classnames":101,"react":496,"react-dom":259,"react-input-autosize":102}],99:[function(_dereq_,module,exports){ 'use strict'; var React = _dereq_('react'); @@ -3962,7 +4301,7 @@ var SingleValue = React.createClass({ }); module.exports = SingleValue; -},{"classnames":89,"react":475}],88:[function(_dereq_,module,exports){ +},{"classnames":101,"react":496}],100:[function(_dereq_,module,exports){ 'use strict'; var React = _dereq_('react'); @@ -4046,7 +4385,7 @@ var Value = React.createClass({ }); module.exports = Value; -},{"classnames":89,"react":475}],89:[function(_dereq_,module,exports){ +},{"classnames":101,"react":496}],101:[function(_dereq_,module,exports){ /*! Copyright (c) 2016 Jed Watson. Licensed under the MIT License (MIT), see @@ -4096,7 +4435,7 @@ module.exports = Value; } }()); -},{}],90:[function(_dereq_,module,exports){ +},{}],102:[function(_dereq_,module,exports){ 'use strict'; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; @@ -4223,7 +4562,7 @@ var AutosizeInput = React.createClass({ }); module.exports = AutosizeInput; -},{"react":475}],91:[function(_dereq_,module,exports){ +},{"react":496}],103:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -4280,7 +4619,7 @@ Table.defaultProps = { condensed: false }; exports.default = Table; -},{"react":475}],92:[function(_dereq_,module,exports){ +},{"react":496}],104:[function(_dereq_,module,exports){ "use strict"; exports.__esModule = true; @@ -4318,7 +4657,7 @@ var TableBody = (function (_React$Component) { })(_react2.default.Component); exports.default = TableBody; -},{"react":475}],93:[function(_dereq_,module,exports){ +},{"react":496}],105:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -4364,7 +4703,7 @@ TableCell.propTypes = { editable: _react.PropTypes.bool }; exports.default = TableCell; -},{"react":475}],94:[function(_dereq_,module,exports){ +},{"react":496}],106:[function(_dereq_,module,exports){ "use strict"; exports.__esModule = true; @@ -4402,7 +4741,7 @@ var TableFoot = (function (_React$Component) { })(_react2.default.Component); exports.default = TableFoot; -},{"react":475}],95:[function(_dereq_,module,exports){ +},{"react":496}],107:[function(_dereq_,module,exports){ "use strict"; exports.__esModule = true; @@ -4440,7 +4779,7 @@ var TableHead = (function (_React$Component) { })(_react2.default.Component); exports.default = TableHead; -},{"react":475}],96:[function(_dereq_,module,exports){ +},{"react":496}],108:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -4486,7 +4825,7 @@ TableCell.propTypes = { editable: _react.PropTypes.bool }; exports.default = TableCell; -},{"react":475}],97:[function(_dereq_,module,exports){ +},{"react":496}],109:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -4538,7 +4877,7 @@ Table.defaultProps = { accent: false }; exports.default = Table; -},{"react":475}],98:[function(_dereq_,module,exports){ +},{"react":496}],110:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -4581,7 +4920,7 @@ exports.TableFoot = _TableFoot3.default; exports.TableHead = _TableHead3.default; exports.TableHeadCell = _TableHeadCell3.default; exports.TableRow = _TableRow3.default; -},{"./Table":91,"./TableBody":92,"./TableCell":93,"./TableFoot":94,"./TableHead":95,"./TableHeadCell":96,"./TableRow":97}],99:[function(_dereq_,module,exports){ +},{"./Table":103,"./TableBody":104,"./TableCell":105,"./TableFoot":106,"./TableHead":107,"./TableHeadCell":108,"./TableRow":109}],111:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -4692,7 +5031,7 @@ Tabs.childContextTypes = { module.exports = Tabs; -},{"cf-component-select":84,"cf-component-viewport":104,"react":475}],100:[function(_dereq_,module,exports){ +},{"cf-component-select":96,"cf-component-viewport":116,"react":496}],112:[function(_dereq_,module,exports){ "use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -4740,12 +5079,12 @@ TabsPanel.contextTypes = { module.exports = TabsPanel; -},{"react":475}],101:[function(_dereq_,module,exports){ +},{"react":496}],113:[function(_dereq_,module,exports){ 'use strict'; exports.Tabs = _dereq_('./Tabs'); exports.TabsPanel = _dereq_('./TabsPanel'); -},{"./Tabs":99,"./TabsPanel":100}],102:[function(_dereq_,module,exports){ +},{"./Tabs":111,"./TabsPanel":112}],114:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -4804,7 +5143,7 @@ Viewport.defaultProps = { module.exports = Viewport; -},{"./buildMediaQuery":103,"react":475,"react-responsive":109}],103:[function(_dereq_,module,exports){ +},{"./buildMediaQuery":115,"react":496,"react-responsive":121}],115:[function(_dereq_,module,exports){ 'use strict'; function buildMediaQuery(_ref, not) { @@ -4833,11 +5172,11 @@ function buildMediaQuery(_ref, not) { } module.exports = buildMediaQuery; -},{}],104:[function(_dereq_,module,exports){ +},{}],116:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./Viewport'); -},{"./Viewport":102}],105:[function(_dereq_,module,exports){ +},{"./Viewport":114}],117:[function(_dereq_,module,exports){ 'use strict'; var uppercasePattern = /[A-Z]/g; @@ -4852,7 +5191,7 @@ function hyphenateStyleName(string) { module.exports = hyphenateStyleName; -},{}],106:[function(_dereq_,module,exports){ +},{}],118:[function(_dereq_,module,exports){ 'use strict'; var staticMatch = _dereq_('css-mediaquery').match; @@ -4900,7 +5239,7 @@ function matchMedia(query, values){ module.exports = matchMedia; -},{"css-mediaquery":107}],107:[function(_dereq_,module,exports){ +},{"css-mediaquery":119}],119:[function(_dereq_,module,exports){ /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. @@ -5059,7 +5398,7 @@ function toPx(length) { } } -},{}],108:[function(_dereq_,module,exports){ +},{}],120:[function(_dereq_,module,exports){ 'use strict'; /* eslint-disable no-unused-vars */ var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -5144,7 +5483,7 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) { return to; }; -},{}],109:[function(_dereq_,module,exports){ +},{}],121:[function(_dereq_,module,exports){ 'use strict'; var React = _dereq_('react'); @@ -5245,7 +5584,8 @@ var mq = React.createClass({ var hasMergeProps = Object.keys(props).length > 0; var wrapChildren = this.props.component || React.Children.count(this.props.children) > 1 || - typeof this.props.children === 'string'; + typeof this.props.children === 'string' || + this.props.children === undefined; if (wrapChildren) { return React.createElement( this.props.component || 'div', @@ -5265,7 +5605,7 @@ var mq = React.createClass({ module.exports = mq; -},{"./mediaQuery":110,"./toQuery":111,"hyphenate-style-name":105,"matchmedia":106,"object-assign":108,"react":475}],110:[function(_dereq_,module,exports){ +},{"./mediaQuery":122,"./toQuery":123,"hyphenate-style-name":117,"matchmedia":118,"object-assign":120,"react":496}],122:[function(_dereq_,module,exports){ var PropTypes = _dereq_('react').PropTypes; var assign = _dereq_('object-assign'); @@ -5364,7 +5704,7 @@ module.exports = { features: features }; -},{"object-assign":108,"react":475}],111:[function(_dereq_,module,exports){ +},{"object-assign":120,"react":496}],123:[function(_dereq_,module,exports){ 'use strict'; var hyphenate = _dereq_('hyphenate-style-name'); @@ -5405,7 +5745,86 @@ module.exports = function(obj){ return join(rules); }; -},{"./mediaQuery":110,"hyphenate-style-name":105}],112:[function(_dereq_,module,exports){ +},{"./mediaQuery":122,"hyphenate-style-name":117}],124:[function(_dereq_,module,exports){ +'use strict'; + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var React = _dereq_('react'); +var PropTypes = React.PropTypes; + +var requiredIf = _dereq_('react-required-if'); + +var Textarea = function (_React$Component) { + _inherits(Textarea, _React$Component); + + function Textarea() { + var _temp, _this, _ret; + + _classCallCheck(this, Textarea); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, _React$Component.call.apply(_React$Component, [this].concat(args))), _this), _this.handleChange = function (e) { + if (_this.props.onChange) { + _this.props.onChange(e.target.value); + } + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + Textarea.prototype.render = function render() { + var className = 'cf-textarea'; + + if (this.props.disabled) className += ' cf-textarea--disabled'; + if (this.props.readOnly) className += ' cf-textarea--readonly'; + + return React.createElement('textarea', { + className: className, + name: this.props.name, + value: this.props.value, + disabled: this.props.disabled, + readOnly: this.props.readOnly, + onChange: this.handleChange, + onFocus: this.props.onFocus, + onBlur: this.props.onBlur }); + }; + + return Textarea; +}(React.Component); + +Textarea.propTypes = { + name: PropTypes.string.isRequired, + value: PropTypes.string.isRequired, + disabled: PropTypes.bool, + readOnly: PropTypes.bool, + onChange: requiredIf(PropTypes.func, function (props) { + return !props.disabled && !props.readOnly; + }), + onFocus: PropTypes.func, + onBlur: PropTypes.func +}; + + +module.exports = Textarea; +},{"react":496,"react-required-if":126}],125:[function(_dereq_,module,exports){ +'use strict'; + +module.exports = _dereq_('./Textarea'); +},{"./Textarea":124}],126:[function(_dereq_,module,exports){ +module.exports = function requiredIf(type, condition) { + return function(props) { + const test = condition(props) ? type.isRequired : type; + return test.apply(this, arguments); + }; +}; + +},{}],127:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -5476,11 +5895,11 @@ Toggle.propTypes = { module.exports = Toggle; -},{"react":475}],113:[function(_dereq_,module,exports){ +},{"react":496}],128:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./Toggle'); -},{"./Toggle":112}],114:[function(_dereq_,module,exports){ +},{"./Toggle":127}],129:[function(_dereq_,module,exports){ 'use strict'; var superagent = _dereq_('superagent'); @@ -5660,11 +6079,11 @@ function del() { } module.exports = { beforeSend: beforeSend, request: request, get: get, post: post, put: put, patch: patch, del: del }; -},{"cf-util-logger":117,"superagent":121}],115:[function(_dereq_,module,exports){ +},{"cf-util-logger":132,"superagent":136}],130:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./http'); -},{"./http":114}],116:[function(_dereq_,module,exports){ +},{"./http":129}],131:[function(_dereq_,module,exports){ 'use strict'; var debug = _dereq_('debug'); @@ -5678,11 +6097,11 @@ function createLogger(name) { } module.exports = createLogger; -},{"debug":118}],117:[function(_dereq_,module,exports){ +},{"debug":133}],132:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('./createLogger'); -},{"./createLogger":116}],118:[function(_dereq_,module,exports){ +},{"./createLogger":131}],133:[function(_dereq_,module,exports){ /** * This is the web browser implementation of `debug()`. @@ -5852,7 +6271,7 @@ function localstorage(){ } catch (e) {} } -},{"./debug":119}],119:[function(_dereq_,module,exports){ +},{"./debug":134}],134:[function(_dereq_,module,exports){ /** * This is the common logic for both the Node.js and web browser @@ -6051,7 +6470,7 @@ function coerce(val) { return val; } -},{"ms":120}],120:[function(_dereq_,module,exports){ +},{"ms":135}],135:[function(_dereq_,module,exports){ /** * Helpers. */ @@ -6178,7 +6597,7 @@ function plural(ms, n, name) { return Math.ceil(ms / n) + ' ' + name + 's'; } -},{}],121:[function(_dereq_,module,exports){ +},{}],136:[function(_dereq_,module,exports){ /** * Module dependencies. */ @@ -7257,7 +7676,7 @@ request.put = function(url, data, fn){ return req; }; -},{"./is-object":122,"./request":124,"./request-base":123,"emitter":125,"reduce":126}],122:[function(_dereq_,module,exports){ +},{"./is-object":137,"./request":139,"./request-base":138,"emitter":140,"reduce":141}],137:[function(_dereq_,module,exports){ /** * Check if `obj` is an object. * @@ -7272,7 +7691,7 @@ function isObject(obj) { module.exports = isObject; -},{}],123:[function(_dereq_,module,exports){ +},{}],138:[function(_dereq_,module,exports){ /** * Module of mixed-in functions shared between node and client code */ @@ -7440,7 +7859,7 @@ exports.field = function(name, val) { return this; }; -},{"./is-object":122}],124:[function(_dereq_,module,exports){ +},{"./is-object":137}],139:[function(_dereq_,module,exports){ // The node and browser modules expose versions of this with the // appropriate constructor function bound as first argument /** @@ -7474,7 +7893,7 @@ function request(RequestConstructor, method, url) { module.exports = request; -},{}],125:[function(_dereq_,module,exports){ +},{}],140:[function(_dereq_,module,exports){ /** * Expose `Emitter`. @@ -7639,7 +8058,7 @@ Emitter.prototype.hasListeners = function(event){ return !! this.listeners(event).length; }; -},{}],126:[function(_dereq_,module,exports){ +},{}],141:[function(_dereq_,module,exports){ /** * Reduce `arr` with `fn`. @@ -7664,7 +8083,7 @@ module.exports = function(arr, fn, initial){ return curr; }; -},{}],127:[function(_dereq_,module,exports){ +},{}],142:[function(_dereq_,module,exports){ /** * Indicates that navigation was caused by a call to history.push. */ @@ -7696,7 +8115,7 @@ exports['default'] = { REPLACE: REPLACE, POP: POP }; -},{}],128:[function(_dereq_,module,exports){ +},{}],143:[function(_dereq_,module,exports){ "use strict"; exports.__esModule = true; @@ -7723,7 +8142,7 @@ function loopAsync(turns, work, callback) { next(); } -},{}],129:[function(_dereq_,module,exports){ +},{}],144:[function(_dereq_,module,exports){ (function (process){ /*eslint-disable no-empty */ 'use strict'; @@ -7795,7 +8214,7 @@ function readState(key) { } }).call(this,_dereq_('_process')) -},{"_process":2,"warning":149}],130:[function(_dereq_,module,exports){ +},{"_process":2,"warning":164}],145:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -7876,13 +8295,13 @@ function supportsGoWithoutReloadUsingHash() { var ua = navigator.userAgent; return ua.indexOf('Firefox') === -1; } -},{}],131:[function(_dereq_,module,exports){ +},{}],146:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); exports.canUseDOM = canUseDOM; -},{}],132:[function(_dereq_,module,exports){ +},{}],147:[function(_dereq_,module,exports){ (function (process){ 'use strict'; @@ -7926,7 +8345,7 @@ exports['default'] = createDOMHistory; module.exports = exports['default']; }).call(this,_dereq_('_process')) -},{"./DOMUtils":130,"./ExecutionEnvironment":131,"./createHistory":134,"_process":2,"invariant":146}],133:[function(_dereq_,module,exports){ +},{"./DOMUtils":145,"./ExecutionEnvironment":146,"./createHistory":149,"_process":2,"invariant":161}],148:[function(_dereq_,module,exports){ (function (process){ 'use strict'; @@ -8178,7 +8597,7 @@ exports['default'] = createHashHistory; module.exports = exports['default']; }).call(this,_dereq_('_process')) -},{"./Actions":127,"./DOMStateStorage":129,"./DOMUtils":130,"./ExecutionEnvironment":131,"./createDOMHistory":132,"./parsePath":139,"_process":2,"invariant":146,"warning":149}],134:[function(_dereq_,module,exports){ +},{"./Actions":142,"./DOMStateStorage":144,"./DOMUtils":145,"./ExecutionEnvironment":146,"./createDOMHistory":147,"./parsePath":154,"_process":2,"invariant":161,"warning":164}],149:[function(_dereq_,module,exports){ //import warning from 'warning' 'use strict'; @@ -8470,7 +8889,7 @@ function createHistory() { exports['default'] = createHistory; module.exports = exports['default']; -},{"./Actions":127,"./AsyncUtils":128,"./createLocation":135,"./deprecate":137,"./parsePath":139,"./runTransitionHook":140,"deep-equal":143}],135:[function(_dereq_,module,exports){ +},{"./Actions":142,"./AsyncUtils":143,"./createLocation":150,"./deprecate":152,"./parsePath":154,"./runTransitionHook":155,"deep-equal":158}],150:[function(_dereq_,module,exports){ //import warning from 'warning' 'use strict'; @@ -8525,7 +8944,7 @@ function createLocation() { exports['default'] = createLocation; module.exports = exports['default']; -},{"./Actions":127,"./parsePath":139}],136:[function(_dereq_,module,exports){ +},{"./Actions":142,"./parsePath":154}],151:[function(_dereq_,module,exports){ (function (process){ 'use strict'; @@ -8684,7 +9103,7 @@ exports['default'] = createMemoryHistory; module.exports = exports['default']; }).call(this,_dereq_('_process')) -},{"./Actions":127,"./createHistory":134,"./parsePath":139,"_process":2,"invariant":146,"warning":149}],137:[function(_dereq_,module,exports){ +},{"./Actions":142,"./createHistory":149,"./parsePath":154,"_process":2,"invariant":161,"warning":164}],152:[function(_dereq_,module,exports){ //import warning from 'warning' "use strict"; @@ -8700,7 +9119,7 @@ function deprecate(fn) { exports["default"] = deprecate; module.exports = exports["default"]; -},{}],138:[function(_dereq_,module,exports){ +},{}],153:[function(_dereq_,module,exports){ "use strict"; exports.__esModule = true; @@ -8714,7 +9133,7 @@ function extractPath(string) { exports["default"] = extractPath; module.exports = exports["default"]; -},{}],139:[function(_dereq_,module,exports){ +},{}],154:[function(_dereq_,module,exports){ (function (process){ 'use strict'; @@ -8762,7 +9181,7 @@ exports['default'] = parsePath; module.exports = exports['default']; }).call(this,_dereq_('_process')) -},{"./extractPath":138,"_process":2,"warning":149}],140:[function(_dereq_,module,exports){ +},{"./extractPath":153,"_process":2,"warning":164}],155:[function(_dereq_,module,exports){ (function (process){ 'use strict'; @@ -8790,7 +9209,7 @@ exports['default'] = runTransitionHook; module.exports = exports['default']; }).call(this,_dereq_('_process')) -},{"_process":2,"warning":149}],141:[function(_dereq_,module,exports){ +},{"_process":2,"warning":164}],156:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -8931,7 +9350,7 @@ function useBasename(createHistory) { exports['default'] = useBasename; module.exports = exports['default']; -},{"./ExecutionEnvironment":131,"./deprecate":137,"./extractPath":138,"./parsePath":139,"./runTransitionHook":140}],142:[function(_dereq_,module,exports){ +},{"./ExecutionEnvironment":146,"./deprecate":152,"./extractPath":153,"./parsePath":154,"./runTransitionHook":155}],157:[function(_dereq_,module,exports){ (function (process){ 'use strict'; @@ -9107,7 +9526,7 @@ exports['default'] = useQueries; module.exports = exports['default']; }).call(this,_dereq_('_process')) -},{"./deprecate":137,"./parsePath":139,"./runTransitionHook":140,"_process":2,"query-string":147,"warning":149}],143:[function(_dereq_,module,exports){ +},{"./deprecate":152,"./parsePath":154,"./runTransitionHook":155,"_process":2,"query-string":162,"warning":164}],158:[function(_dereq_,module,exports){ var pSlice = Array.prototype.slice; var objectKeys = _dereq_('./lib/keys.js'); var isArguments = _dereq_('./lib/is_arguments.js'); @@ -9203,7 +9622,7 @@ function objEquiv(a, b, opts) { return typeof a === typeof b; } -},{"./lib/is_arguments.js":144,"./lib/keys.js":145}],144:[function(_dereq_,module,exports){ +},{"./lib/is_arguments.js":159,"./lib/keys.js":160}],159:[function(_dereq_,module,exports){ var supportsArgumentsClass = (function(){ return Object.prototype.toString.call(arguments) })() == '[object Arguments]'; @@ -9225,7 +9644,7 @@ function unsupported(object){ false; }; -},{}],145:[function(_dereq_,module,exports){ +},{}],160:[function(_dereq_,module,exports){ exports = module.exports = typeof Object.keys === 'function' ? Object.keys : shim; @@ -9236,7 +9655,7 @@ function shim (obj) { return keys; } -},{}],146:[function(_dereq_,module,exports){ +},{}],161:[function(_dereq_,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -9292,7 +9711,7 @@ module.exports = invariant; }).call(this,_dereq_('_process')) -},{"_process":2}],147:[function(_dereq_,module,exports){ +},{"_process":2}],162:[function(_dereq_,module,exports){ 'use strict'; var strictUriEncode = _dereq_('strict-uri-encode'); @@ -9360,7 +9779,7 @@ exports.stringify = function (obj) { }).join('&') : ''; }; -},{"strict-uri-encode":148}],148:[function(_dereq_,module,exports){ +},{"strict-uri-encode":163}],163:[function(_dereq_,module,exports){ 'use strict'; module.exports = function (str) { return encodeURIComponent(str).replace(/[!'()*]/g, function (c) { @@ -9368,7 +9787,7 @@ module.exports = function (str) { }); }; -},{}],149:[function(_dereq_,module,exports){ +},{}],164:[function(_dereq_,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -9433,7 +9852,7 @@ module.exports = warning; }).call(this,_dereq_('_process')) -},{"_process":2}],150:[function(_dereq_,module,exports){ +},{"_process":2}],165:[function(_dereq_,module,exports){ (function (global){ // Expose `IntlPolyfill` as global to add locale data into runtime later on. global.IntlPolyfill = _dereq_('./lib/core.js'); @@ -9453,7 +9872,7 @@ module.exports = global.IntlPolyfill; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./lib/core.js":151,"./locale-data/complete.js":1}],151:[function(_dereq_,module,exports){ +},{"./lib/core.js":166,"./locale-data/complete.js":1}],166:[function(_dereq_,module,exports){ 'use strict'; var babelHelpers = {}; @@ -13250,7 +13669,7 @@ function addLocaleData(data, tag) { } module.exports = Intl; -},{}],152:[function(_dereq_,module,exports){ +},{}],167:[function(_dereq_,module,exports){ (function (global){ /** * @license @@ -25606,7 +26025,7 @@ module.exports = Intl; }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],153:[function(_dereq_,module,exports){ +},{}],168:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -25636,6 +26055,7 @@ var EntitySchema = function () { }; this._idAttribute = idAttribute; this._meta = options.meta; + this._defaults = options.defaults; } _createClass(EntitySchema, [{ @@ -25666,6 +26086,11 @@ var EntitySchema = function () { } return this._meta && this._meta[prop]; } + }, { + key: 'getDefaults', + value: function getDefaults() { + return this._defaults; + } }, { key: 'define', value: function define(nestedSchema) { @@ -25681,7 +26106,7 @@ var EntitySchema = function () { }(); exports.default = EntitySchema; -},{}],154:[function(_dereq_,module,exports){ +},{}],169:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -25731,7 +26156,7 @@ var ArraySchema = function () { }(); exports.default = ArraySchema; -},{"./UnionSchema":155,"lodash/isObject":230}],155:[function(_dereq_,module,exports){ +},{"./UnionSchema":170,"lodash/isObject":250}],170:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { @@ -25784,13 +26209,16 @@ var UnionSchema = function () { }(); exports.default = UnionSchema; -},{"lodash/isObject":230}],156:[function(_dereq_,module,exports){ +},{"lodash/isObject":250}],171:[function(_dereq_,module,exports){ 'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.Schema = undefined; + +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + exports.arrayOf = arrayOf; exports.valuesOf = valuesOf; exports.unionOf = unionOf; @@ -25827,10 +26255,11 @@ function visitObject(obj, schema, bag, options) { var assignEntity = _options$assignEntity === undefined ? defaultAssignEntity : _options$assignEntity; - var normalized = {}; + var defaults = schema && schema.getDefaults && schema.getDefaults(); + var schemaAssignEntity = schema && schema.getAssignEntity && schema.getAssignEntity(); + var normalized = (0, _isObject2.default)(defaults) ? _extends({}, defaults) : {}; for (var key in obj) { if (obj.hasOwnProperty(key)) { - var schemaAssignEntity = schema && schema.getAssignEntity && schema.getAssignEntity(); var entity = visit(obj[key], schema[key], bag, options); assignEntity.call(null, normalized, key, entity, obj, schema); if (schemaAssignEntity) { @@ -25960,7 +26389,7 @@ function normalize(obj, schema) { result: result }; } -},{"./EntitySchema":153,"./IterableSchema":154,"./UnionSchema":155,"lodash/isEqual":227,"lodash/isObject":230}],157:[function(_dereq_,module,exports){ +},{"./EntitySchema":168,"./IterableSchema":169,"./UnionSchema":170,"lodash/isEqual":247,"lodash/isObject":250}],172:[function(_dereq_,module,exports){ var getNative = _dereq_('./_getNative'), root = _dereq_('./_root'); @@ -25969,7 +26398,7 @@ var DataView = getNative(root, 'DataView'); module.exports = DataView; -},{"./_getNative":185,"./_root":212}],158:[function(_dereq_,module,exports){ +},{"./_getNative":203,"./_root":232}],173:[function(_dereq_,module,exports){ var hashClear = _dereq_('./_hashClear'), hashDelete = _dereq_('./_hashDelete'), hashGet = _dereq_('./_hashGet'), @@ -26003,7 +26432,7 @@ Hash.prototype.set = hashSet; module.exports = Hash; -},{"./_hashClear":189,"./_hashDelete":190,"./_hashGet":191,"./_hashHas":192,"./_hashSet":193}],159:[function(_dereq_,module,exports){ +},{"./_hashClear":207,"./_hashDelete":208,"./_hashGet":209,"./_hashHas":210,"./_hashSet":211}],174:[function(_dereq_,module,exports){ var listCacheClear = _dereq_('./_listCacheClear'), listCacheDelete = _dereq_('./_listCacheDelete'), listCacheGet = _dereq_('./_listCacheGet'), @@ -26037,7 +26466,7 @@ ListCache.prototype.set = listCacheSet; module.exports = ListCache; -},{"./_listCacheClear":200,"./_listCacheDelete":201,"./_listCacheGet":202,"./_listCacheHas":203,"./_listCacheSet":204}],160:[function(_dereq_,module,exports){ +},{"./_listCacheClear":218,"./_listCacheDelete":219,"./_listCacheGet":220,"./_listCacheHas":221,"./_listCacheSet":222}],175:[function(_dereq_,module,exports){ var getNative = _dereq_('./_getNative'), root = _dereq_('./_root'); @@ -26046,7 +26475,7 @@ var Map = getNative(root, 'Map'); module.exports = Map; -},{"./_getNative":185,"./_root":212}],161:[function(_dereq_,module,exports){ +},{"./_getNative":203,"./_root":232}],176:[function(_dereq_,module,exports){ var mapCacheClear = _dereq_('./_mapCacheClear'), mapCacheDelete = _dereq_('./_mapCacheDelete'), mapCacheGet = _dereq_('./_mapCacheGet'), @@ -26080,7 +26509,7 @@ MapCache.prototype.set = mapCacheSet; module.exports = MapCache; -},{"./_mapCacheClear":205,"./_mapCacheDelete":206,"./_mapCacheGet":207,"./_mapCacheHas":208,"./_mapCacheSet":209}],162:[function(_dereq_,module,exports){ +},{"./_mapCacheClear":223,"./_mapCacheDelete":224,"./_mapCacheGet":225,"./_mapCacheHas":226,"./_mapCacheSet":227}],177:[function(_dereq_,module,exports){ var getNative = _dereq_('./_getNative'), root = _dereq_('./_root'); @@ -26089,7 +26518,7 @@ var Promise = getNative(root, 'Promise'); module.exports = Promise; -},{"./_getNative":185,"./_root":212}],163:[function(_dereq_,module,exports){ +},{"./_getNative":203,"./_root":232}],178:[function(_dereq_,module,exports){ var getNative = _dereq_('./_getNative'), root = _dereq_('./_root'); @@ -26098,7 +26527,7 @@ var Set = getNative(root, 'Set'); module.exports = Set; -},{"./_getNative":185,"./_root":212}],164:[function(_dereq_,module,exports){ +},{"./_getNative":203,"./_root":232}],179:[function(_dereq_,module,exports){ var MapCache = _dereq_('./_MapCache'), setCacheAdd = _dereq_('./_setCacheAdd'), setCacheHas = _dereq_('./_setCacheHas'); @@ -26127,7 +26556,7 @@ SetCache.prototype.has = setCacheHas; module.exports = SetCache; -},{"./_MapCache":161,"./_setCacheAdd":213,"./_setCacheHas":214}],165:[function(_dereq_,module,exports){ +},{"./_MapCache":176,"./_setCacheAdd":233,"./_setCacheHas":234}],180:[function(_dereq_,module,exports){ var ListCache = _dereq_('./_ListCache'), stackClear = _dereq_('./_stackClear'), stackDelete = _dereq_('./_stackDelete'), @@ -26155,7 +26584,7 @@ Stack.prototype.set = stackSet; module.exports = Stack; -},{"./_ListCache":159,"./_stackClear":216,"./_stackDelete":217,"./_stackGet":218,"./_stackHas":219,"./_stackSet":220}],166:[function(_dereq_,module,exports){ +},{"./_ListCache":174,"./_stackClear":236,"./_stackDelete":237,"./_stackGet":238,"./_stackHas":239,"./_stackSet":240}],181:[function(_dereq_,module,exports){ var root = _dereq_('./_root'); /** Built-in value references. */ @@ -26163,7 +26592,7 @@ var Symbol = root.Symbol; module.exports = Symbol; -},{"./_root":212}],167:[function(_dereq_,module,exports){ +},{"./_root":232}],182:[function(_dereq_,module,exports){ var root = _dereq_('./_root'); /** Built-in value references. */ @@ -26171,7 +26600,7 @@ var Uint8Array = root.Uint8Array; module.exports = Uint8Array; -},{"./_root":212}],168:[function(_dereq_,module,exports){ +},{"./_root":232}],183:[function(_dereq_,module,exports){ var getNative = _dereq_('./_getNative'), root = _dereq_('./_root'); @@ -26180,7 +26609,7 @@ var WeakMap = getNative(root, 'WeakMap'); module.exports = WeakMap; -},{"./_getNative":185,"./_root":212}],169:[function(_dereq_,module,exports){ +},{"./_getNative":203,"./_root":232}],184:[function(_dereq_,module,exports){ /** * A specialized version of `_.some` for arrays without support for iteratee * shorthands. @@ -26205,7 +26634,7 @@ function arraySome(array, predicate) { module.exports = arraySome; -},{}],170:[function(_dereq_,module,exports){ +},{}],185:[function(_dereq_,module,exports){ var eq = _dereq_('./eq'); /** @@ -26228,9 +26657,33 @@ function assocIndexOf(array, key) { module.exports = assocIndexOf; -},{"./eq":222}],171:[function(_dereq_,module,exports){ -arguments[4][24][0].apply(exports,arguments) -},{"./_getPrototype":186,"dup":24}],172:[function(_dereq_,module,exports){ +},{"./eq":242}],186:[function(_dereq_,module,exports){ +/** Used for built-in method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +module.exports = baseGetTag; + +},{}],187:[function(_dereq_,module,exports){ +arguments[4][25][0].apply(exports,arguments) +},{"./_getPrototype":204,"dup":25}],188:[function(_dereq_,module,exports){ var baseIsEqualDeep = _dereq_('./_baseIsEqualDeep'), isObject = _dereq_('./isObject'), isObjectLike = _dereq_('./isObjectLike'); @@ -26262,7 +26715,7 @@ function baseIsEqual(value, other, customizer, bitmask, stack) { module.exports = baseIsEqual; -},{"./_baseIsEqualDeep":173,"./isObject":230,"./isObjectLike":231}],173:[function(_dereq_,module,exports){ +},{"./_baseIsEqualDeep":189,"./isObject":250,"./isObjectLike":251}],189:[function(_dereq_,module,exports){ var Stack = _dereq_('./_Stack'), equalArrays = _dereq_('./_equalArrays'), equalByTag = _dereq_('./_equalByTag'), @@ -26346,7 +26799,7 @@ function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { module.exports = baseIsEqualDeep; -},{"./_Stack":165,"./_equalArrays":180,"./_equalByTag":181,"./_equalObjects":182,"./_getTag":187,"./_isHostObject":195,"./isArray":224,"./isTypedArray":233}],174:[function(_dereq_,module,exports){ +},{"./_Stack":180,"./_equalArrays":197,"./_equalByTag":198,"./_equalObjects":199,"./_getTag":205,"./_isHostObject":213,"./isArray":244,"./isTypedArray":253}],190:[function(_dereq_,module,exports){ var isFunction = _dereq_('./isFunction'), isHostObject = _dereq_('./_isHostObject'), isMasked = _dereq_('./_isMasked'), @@ -26395,27 +26848,100 @@ function baseIsNative(value) { module.exports = baseIsNative; -},{"./_isHostObject":195,"./_isMasked":198,"./_toSource":221,"./isFunction":228,"./isObject":230}],175:[function(_dereq_,module,exports){ -arguments[4][26][0].apply(exports,arguments) -},{"dup":26}],176:[function(_dereq_,module,exports){ -arguments[4][27][0].apply(exports,arguments) -},{"dup":27}],177:[function(_dereq_,module,exports){ -arguments[4][28][0].apply(exports,arguments) -},{"dup":28}],178:[function(_dereq_,module,exports){ +},{"./_isHostObject":213,"./_isMasked":216,"./_toSource":241,"./isFunction":248,"./isObject":250}],191:[function(_dereq_,module,exports){ +var isLength = _dereq_('./isLength'), + isObjectLike = _dereq_('./isObjectLike'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = +typedArrayTags[errorTag] = typedArrayTags[funcTag] = +typedArrayTags[mapTag] = typedArrayTags[numberTag] = +typedArrayTags[objectTag] = typedArrayTags[regexpTag] = +typedArrayTags[setTag] = typedArrayTags[stringTag] = +typedArrayTags[weakMapTag] = false; + +/** Used for built-in method references. */ +var objectProto = Object.prototype; + /** - * Checks if `value` is a global object. + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** + * The base implementation of `_.isTypedArray` without Node.js optimizations. * * @private * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ +function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; +} + +module.exports = baseIsTypedArray; + +},{"./isLength":249,"./isObjectLike":251}],192:[function(_dereq_,module,exports){ +arguments[4][28][0].apply(exports,arguments) +},{"./_overArg":231,"dup":28}],193:[function(_dereq_,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],194:[function(_dereq_,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"dup":30}],195:[function(_dereq_,module,exports){ +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; +function baseUnary(func) { + return function(value) { + return func(value); + }; } -module.exports = checkGlobal; +module.exports = baseUnary; -},{}],179:[function(_dereq_,module,exports){ +},{}],196:[function(_dereq_,module,exports){ var root = _dereq_('./_root'); /** Used to detect overreaching core-js shims. */ @@ -26423,7 +26949,7 @@ var coreJsData = root['__core-js_shared__']; module.exports = coreJsData; -},{"./_root":212}],180:[function(_dereq_,module,exports){ +},{"./_root":232}],197:[function(_dereq_,module,exports){ var SetCache = _dereq_('./_SetCache'), arraySome = _dereq_('./_arraySome'); @@ -26455,7 +26981,7 @@ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { } // Assume cyclic values are equal. var stacked = stack.get(array); - if (stacked) { + if (stacked && stack.get(other)) { return stacked == other; } var index = -1, @@ -26463,6 +26989,7 @@ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; stack.set(array, other); + stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { @@ -26501,14 +27028,16 @@ function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { } } stack['delete'](array); + stack['delete'](other); return result; } module.exports = equalArrays; -},{"./_SetCache":164,"./_arraySome":169}],181:[function(_dereq_,module,exports){ +},{"./_SetCache":179,"./_arraySome":184}],198:[function(_dereq_,module,exports){ var Symbol = _dereq_('./_Symbol'), Uint8Array = _dereq_('./_Uint8Array'), + eq = _dereq_('./eq'), equalArrays = _dereq_('./_equalArrays'), mapToArray = _dereq_('./_mapToArray'), setToArray = _dereq_('./_setToArray'); @@ -26572,18 +27101,14 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { case boolTag: case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and - // booleans to `1` or `0` treating invalid dates coerced to `NaN` as - // not equal. - return +object == +other; + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, @@ -26607,10 +27132,12 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { return stacked == other; } bitmask |= UNORDERED_COMPARE_FLAG; - stack.set(object, other); // Recursively compare objects (susceptible to call stack limits). - return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; case symbolTag: if (symbolValueOf) { @@ -26622,7 +27149,7 @@ function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { module.exports = equalByTag; -},{"./_Symbol":166,"./_Uint8Array":167,"./_equalArrays":180,"./_mapToArray":210,"./_setToArray":215}],182:[function(_dereq_,module,exports){ +},{"./_Symbol":181,"./_Uint8Array":182,"./_equalArrays":197,"./_mapToArray":228,"./_setToArray":235,"./eq":242}],199:[function(_dereq_,module,exports){ var baseHas = _dereq_('./_baseHas'), keys = _dereq_('./keys'); @@ -26662,11 +27189,12 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { } // Assume cyclic values are equal. var stacked = stack.get(object); - if (stacked) { + if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); + stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { @@ -26702,14 +27230,24 @@ function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { } } stack['delete'](object); + stack['delete'](other); return result; } module.exports = equalObjects; -},{"./_baseHas":171,"./keys":234}],183:[function(_dereq_,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"./_baseProperty":176,"dup":30}],184:[function(_dereq_,module,exports){ +},{"./_baseHas":187,"./keys":254}],200:[function(_dereq_,module,exports){ +(function (global){ +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +module.exports = freeGlobal; + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + +},{}],201:[function(_dereq_,module,exports){ +arguments[4][32][0].apply(exports,arguments) +},{"./_baseProperty":193,"dup":32}],202:[function(_dereq_,module,exports){ var isKeyable = _dereq_('./_isKeyable'); /** @@ -26729,7 +27267,7 @@ function getMapData(map, key) { module.exports = getMapData; -},{"./_isKeyable":197}],185:[function(_dereq_,module,exports){ +},{"./_isKeyable":215}],203:[function(_dereq_,module,exports){ var baseIsNative = _dereq_('./_baseIsNative'), getValue = _dereq_('./_getValue'); @@ -26748,14 +27286,15 @@ function getNative(object, key) { module.exports = getNative; -},{"./_baseIsNative":174,"./_getValue":188}],186:[function(_dereq_,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],187:[function(_dereq_,module,exports){ +},{"./_baseIsNative":190,"./_getValue":206}],204:[function(_dereq_,module,exports){ +arguments[4][33][0].apply(exports,arguments) +},{"./_overArg":231,"dup":33}],205:[function(_dereq_,module,exports){ var DataView = _dereq_('./_DataView'), Map = _dereq_('./_Map'), Promise = _dereq_('./_Promise'), Set = _dereq_('./_Set'), WeakMap = _dereq_('./_WeakMap'), + baseGetTag = _dereq_('./_baseGetTag'), toSource = _dereq_('./_toSource'); /** `Object#toString` result references. */ @@ -26791,9 +27330,7 @@ var dataViewCtorString = toSource(DataView), * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ -function getTag(value) { - return objectToString.call(value); -} +var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11, // for data views in Edge, and promises in Node.js. @@ -26822,7 +27359,7 @@ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || module.exports = getTag; -},{"./_DataView":157,"./_Map":160,"./_Promise":162,"./_Set":163,"./_WeakMap":168,"./_toSource":221}],188:[function(_dereq_,module,exports){ +},{"./_DataView":172,"./_Map":175,"./_Promise":177,"./_Set":178,"./_WeakMap":183,"./_baseGetTag":186,"./_toSource":241}],206:[function(_dereq_,module,exports){ /** * Gets the value at `key` of `object`. * @@ -26837,7 +27374,7 @@ function getValue(object, key) { module.exports = getValue; -},{}],189:[function(_dereq_,module,exports){ +},{}],207:[function(_dereq_,module,exports){ var nativeCreate = _dereq_('./_nativeCreate'); /** @@ -26853,7 +27390,7 @@ function hashClear() { module.exports = hashClear; -},{"./_nativeCreate":211}],190:[function(_dereq_,module,exports){ +},{"./_nativeCreate":229}],208:[function(_dereq_,module,exports){ /** * Removes `key` and its value from the hash. * @@ -26870,7 +27407,7 @@ function hashDelete(key) { module.exports = hashDelete; -},{}],191:[function(_dereq_,module,exports){ +},{}],209:[function(_dereq_,module,exports){ var nativeCreate = _dereq_('./_nativeCreate'); /** Used to stand-in for `undefined` hash values. */ @@ -26902,7 +27439,7 @@ function hashGet(key) { module.exports = hashGet; -},{"./_nativeCreate":211}],192:[function(_dereq_,module,exports){ +},{"./_nativeCreate":229}],210:[function(_dereq_,module,exports){ var nativeCreate = _dereq_('./_nativeCreate'); /** Used for built-in method references. */ @@ -26927,7 +27464,7 @@ function hashHas(key) { module.exports = hashHas; -},{"./_nativeCreate":211}],193:[function(_dereq_,module,exports){ +},{"./_nativeCreate":229}],211:[function(_dereq_,module,exports){ var nativeCreate = _dereq_('./_nativeCreate'); /** Used to stand-in for `undefined` hash values. */ @@ -26951,9 +27488,9 @@ function hashSet(key, value) { module.exports = hashSet; -},{"./_nativeCreate":211}],194:[function(_dereq_,module,exports){ -arguments[4][32][0].apply(exports,arguments) -},{"./_baseTimes":177,"./isArguments":223,"./isArray":224,"./isLength":229,"./isString":232,"dup":32}],195:[function(_dereq_,module,exports){ +},{"./_nativeCreate":229}],212:[function(_dereq_,module,exports){ +arguments[4][34][0].apply(exports,arguments) +},{"./_baseTimes":194,"./isArguments":243,"./isArray":244,"./isLength":249,"./isString":252,"dup":34}],213:[function(_dereq_,module,exports){ /** * Checks if `value` is a host object in IE < 9. * @@ -26975,9 +27512,9 @@ function isHostObject(value) { module.exports = isHostObject; -},{}],196:[function(_dereq_,module,exports){ -arguments[4][34][0].apply(exports,arguments) -},{"dup":34}],197:[function(_dereq_,module,exports){ +},{}],214:[function(_dereq_,module,exports){ +arguments[4][35][0].apply(exports,arguments) +},{"dup":35}],215:[function(_dereq_,module,exports){ /** * Checks if `value` is suitable for use as unique object key. * @@ -26994,7 +27531,7 @@ function isKeyable(value) { module.exports = isKeyable; -},{}],198:[function(_dereq_,module,exports){ +},{}],216:[function(_dereq_,module,exports){ var coreJsData = _dereq_('./_coreJsData'); /** Used to detect methods masquerading as native. */ @@ -27016,9 +27553,9 @@ function isMasked(func) { module.exports = isMasked; -},{"./_coreJsData":179}],199:[function(_dereq_,module,exports){ -arguments[4][35][0].apply(exports,arguments) -},{"dup":35}],200:[function(_dereq_,module,exports){ +},{"./_coreJsData":196}],217:[function(_dereq_,module,exports){ +arguments[4][36][0].apply(exports,arguments) +},{"dup":36}],218:[function(_dereq_,module,exports){ /** * Removes all key-value entries from the list cache. * @@ -27032,7 +27569,7 @@ function listCacheClear() { module.exports = listCacheClear; -},{}],201:[function(_dereq_,module,exports){ +},{}],219:[function(_dereq_,module,exports){ var assocIndexOf = _dereq_('./_assocIndexOf'); /** Used for built-in method references. */ @@ -27068,7 +27605,7 @@ function listCacheDelete(key) { module.exports = listCacheDelete; -},{"./_assocIndexOf":170}],202:[function(_dereq_,module,exports){ +},{"./_assocIndexOf":185}],220:[function(_dereq_,module,exports){ var assocIndexOf = _dereq_('./_assocIndexOf'); /** @@ -27089,7 +27626,7 @@ function listCacheGet(key) { module.exports = listCacheGet; -},{"./_assocIndexOf":170}],203:[function(_dereq_,module,exports){ +},{"./_assocIndexOf":185}],221:[function(_dereq_,module,exports){ var assocIndexOf = _dereq_('./_assocIndexOf'); /** @@ -27107,7 +27644,7 @@ function listCacheHas(key) { module.exports = listCacheHas; -},{"./_assocIndexOf":170}],204:[function(_dereq_,module,exports){ +},{"./_assocIndexOf":185}],222:[function(_dereq_,module,exports){ var assocIndexOf = _dereq_('./_assocIndexOf'); /** @@ -27134,7 +27671,7 @@ function listCacheSet(key, value) { module.exports = listCacheSet; -},{"./_assocIndexOf":170}],205:[function(_dereq_,module,exports){ +},{"./_assocIndexOf":185}],223:[function(_dereq_,module,exports){ var Hash = _dereq_('./_Hash'), ListCache = _dereq_('./_ListCache'), Map = _dereq_('./_Map'); @@ -27156,7 +27693,7 @@ function mapCacheClear() { module.exports = mapCacheClear; -},{"./_Hash":158,"./_ListCache":159,"./_Map":160}],206:[function(_dereq_,module,exports){ +},{"./_Hash":173,"./_ListCache":174,"./_Map":175}],224:[function(_dereq_,module,exports){ var getMapData = _dereq_('./_getMapData'); /** @@ -27174,7 +27711,7 @@ function mapCacheDelete(key) { module.exports = mapCacheDelete; -},{"./_getMapData":184}],207:[function(_dereq_,module,exports){ +},{"./_getMapData":202}],225:[function(_dereq_,module,exports){ var getMapData = _dereq_('./_getMapData'); /** @@ -27192,7 +27729,7 @@ function mapCacheGet(key) { module.exports = mapCacheGet; -},{"./_getMapData":184}],208:[function(_dereq_,module,exports){ +},{"./_getMapData":202}],226:[function(_dereq_,module,exports){ var getMapData = _dereq_('./_getMapData'); /** @@ -27210,7 +27747,7 @@ function mapCacheHas(key) { module.exports = mapCacheHas; -},{"./_getMapData":184}],209:[function(_dereq_,module,exports){ +},{"./_getMapData":202}],227:[function(_dereq_,module,exports){ var getMapData = _dereq_('./_getMapData'); /** @@ -27230,7 +27767,7 @@ function mapCacheSet(key, value) { module.exports = mapCacheSet; -},{"./_getMapData":184}],210:[function(_dereq_,module,exports){ +},{"./_getMapData":202}],228:[function(_dereq_,module,exports){ /** * Converts `map` to its key-value pairs. * @@ -27250,7 +27787,7 @@ function mapToArray(map) { module.exports = mapToArray; -},{}],211:[function(_dereq_,module,exports){ +},{}],229:[function(_dereq_,module,exports){ var getNative = _dereq_('./_getNative'); /* Built-in method references that are verified to be native. */ @@ -27258,27 +27795,44 @@ var nativeCreate = getNative(Object, 'create'); module.exports = nativeCreate; -},{"./_getNative":185}],212:[function(_dereq_,module,exports){ -(function (global){ -var checkGlobal = _dereq_('./_checkGlobal'); +},{"./_getNative":203}],230:[function(_dereq_,module,exports){ +var freeGlobal = _dereq_('./_freeGlobal'); -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(typeof global == 'object' && global); +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(typeof self == 'object' && self); +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** Detect free variable `process` from Node.js. */ +var freeProcess = moduleExports && freeGlobal.process; + +/** Used to access faster Node.js helpers. */ +var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} +}()); + +module.exports = nodeUtil; -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(typeof this == 'object' && this); +},{"./_freeGlobal":200}],231:[function(_dereq_,module,exports){ +arguments[4][37][0].apply(exports,arguments) +},{"dup":37}],232:[function(_dereq_,module,exports){ +var freeGlobal = _dereq_('./_freeGlobal'); + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ -var root = freeGlobal || freeSelf || thisGlobal || Function('return this')(); +var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) - -},{"./_checkGlobal":178}],213:[function(_dereq_,module,exports){ +},{"./_freeGlobal":200}],233:[function(_dereq_,module,exports){ /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; @@ -27299,7 +27853,7 @@ function setCacheAdd(value) { module.exports = setCacheAdd; -},{}],214:[function(_dereq_,module,exports){ +},{}],234:[function(_dereq_,module,exports){ /** * Checks if `value` is in the array cache. * @@ -27315,7 +27869,7 @@ function setCacheHas(value) { module.exports = setCacheHas; -},{}],215:[function(_dereq_,module,exports){ +},{}],235:[function(_dereq_,module,exports){ /** * Converts `set` to an array of its values. * @@ -27335,7 +27889,7 @@ function setToArray(set) { module.exports = setToArray; -},{}],216:[function(_dereq_,module,exports){ +},{}],236:[function(_dereq_,module,exports){ var ListCache = _dereq_('./_ListCache'); /** @@ -27351,7 +27905,7 @@ function stackClear() { module.exports = stackClear; -},{"./_ListCache":159}],217:[function(_dereq_,module,exports){ +},{"./_ListCache":174}],237:[function(_dereq_,module,exports){ /** * Removes `key` and its value from the stack. * @@ -27367,7 +27921,7 @@ function stackDelete(key) { module.exports = stackDelete; -},{}],218:[function(_dereq_,module,exports){ +},{}],238:[function(_dereq_,module,exports){ /** * Gets the stack value for `key`. * @@ -27383,7 +27937,7 @@ function stackGet(key) { module.exports = stackGet; -},{}],219:[function(_dereq_,module,exports){ +},{}],239:[function(_dereq_,module,exports){ /** * Checks if a stack value for `key` exists. * @@ -27399,8 +27953,9 @@ function stackHas(key) { module.exports = stackHas; -},{}],220:[function(_dereq_,module,exports){ +},{}],240:[function(_dereq_,module,exports){ var ListCache = _dereq_('./_ListCache'), + Map = _dereq_('./_Map'), MapCache = _dereq_('./_MapCache'); /** Used as the size to enable large array optimizations. */ @@ -27418,8 +27973,13 @@ var LARGE_ARRAY_SIZE = 200; */ function stackSet(key, value) { var cache = this.__data__; - if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) { - cache = this.__data__ = new MapCache(cache.__data__); + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); } cache.set(key, value); return this; @@ -27427,7 +27987,7 @@ function stackSet(key, value) { module.exports = stackSet; -},{"./_ListCache":159,"./_MapCache":161}],221:[function(_dereq_,module,exports){ +},{"./_ListCache":174,"./_Map":175,"./_MapCache":176}],241:[function(_dereq_,module,exports){ /** Used to resolve the decompiled source of functions. */ var funcToString = Function.prototype.toString; @@ -27452,7 +28012,7 @@ function toSource(func) { module.exports = toSource; -},{}],222:[function(_dereq_,module,exports){ +},{}],242:[function(_dereq_,module,exports){ /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) @@ -27467,8 +28027,8 @@ module.exports = toSource; * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.eq(object, object); * // => true @@ -27491,15 +28051,15 @@ function eq(value, other) { module.exports = eq; -},{}],223:[function(_dereq_,module,exports){ -arguments[4][37][0].apply(exports,arguments) -},{"./isArrayLikeObject":226,"dup":37}],224:[function(_dereq_,module,exports){ -arguments[4][38][0].apply(exports,arguments) -},{"dup":38}],225:[function(_dereq_,module,exports){ +},{}],243:[function(_dereq_,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"./_getLength":183,"./isFunction":228,"./isLength":229,"dup":39}],226:[function(_dereq_,module,exports){ +},{"./isArrayLikeObject":246,"dup":39}],244:[function(_dereq_,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"./isArrayLike":225,"./isObjectLike":231,"dup":40}],227:[function(_dereq_,module,exports){ +},{"dup":40}],245:[function(_dereq_,module,exports){ +arguments[4][41][0].apply(exports,arguments) +},{"./_getLength":201,"./isFunction":248,"./isLength":249,"dup":41}],246:[function(_dereq_,module,exports){ +arguments[4][42][0].apply(exports,arguments) +},{"./isArrayLike":245,"./isObjectLike":251,"dup":42}],247:[function(_dereq_,module,exports){ var baseIsEqual = _dereq_('./_baseIsEqual'); /** @@ -27522,8 +28082,8 @@ var baseIsEqual = _dereq_('./_baseIsEqual'); * else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true @@ -27537,72 +28097,23 @@ function isEqual(value, other) { module.exports = isEqual; -},{"./_baseIsEqual":172}],228:[function(_dereq_,module,exports){ -arguments[4][41][0].apply(exports,arguments) -},{"./isObject":230,"dup":41}],229:[function(_dereq_,module,exports){ -arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],230:[function(_dereq_,module,exports){ +},{"./_baseIsEqual":188}],248:[function(_dereq_,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"dup":43}],231:[function(_dereq_,module,exports){ +},{"./isObject":250,"dup":43}],249:[function(_dereq_,module,exports){ arguments[4][44][0].apply(exports,arguments) -},{"dup":44}],232:[function(_dereq_,module,exports){ +},{"dup":44}],250:[function(_dereq_,module,exports){ arguments[4][45][0].apply(exports,arguments) -},{"./isArray":224,"./isObjectLike":231,"dup":45}],233:[function(_dereq_,module,exports){ -var isLength = _dereq_('./isLength'), - isObjectLike = _dereq_('./isObjectLike'); - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to identify `toStringTag` values of typed arrays. */ -var typedArrayTags = {}; -typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = -typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = -typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = -typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = -typedArrayTags[uint32Tag] = true; -typedArrayTags[argsTag] = typedArrayTags[arrayTag] = -typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = -typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = -typedArrayTags[errorTag] = typedArrayTags[funcTag] = -typedArrayTags[mapTag] = typedArrayTags[numberTag] = -typedArrayTags[objectTag] = typedArrayTags[regexpTag] = -typedArrayTags[setTag] = typedArrayTags[stringTag] = -typedArrayTags[weakMapTag] = false; +},{"dup":45}],251:[function(_dereq_,module,exports){ +arguments[4][46][0].apply(exports,arguments) +},{"dup":46}],252:[function(_dereq_,module,exports){ +arguments[4][47][0].apply(exports,arguments) +},{"./isArray":244,"./isObjectLike":251,"dup":47}],253:[function(_dereq_,module,exports){ +var baseIsTypedArray = _dereq_('./_baseIsTypedArray'), + baseUnary = _dereq_('./_baseUnary'), + nodeUtil = _dereq_('./_nodeUtil'); -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; +/* Node.js helper references. */ +var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /** * Checks if `value` is classified as a typed array. @@ -27612,8 +28123,7 @@ var objectToString = objectProto.toString; * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); @@ -27622,18 +28132,15 @@ var objectToString = objectProto.toString; * _.isTypedArray([]); * // => false */ -function isTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; -} +var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; module.exports = isTypedArray; -},{"./isLength":229,"./isObjectLike":231}],234:[function(_dereq_,module,exports){ -arguments[4][47][0].apply(exports,arguments) -},{"./_baseHas":171,"./_baseKeys":175,"./_indexKeys":194,"./_isIndex":196,"./_isPrototype":199,"./isArrayLike":225,"dup":47}],235:[function(_dereq_,module,exports){ +},{"./_baseIsTypedArray":191,"./_baseUnary":195,"./_nodeUtil":230}],254:[function(_dereq_,module,exports){ +arguments[4][49][0].apply(exports,arguments) +},{"./_baseHas":187,"./_baseKeys":192,"./_indexKeys":212,"./_isIndex":214,"./_isPrototype":217,"./isArrayLike":245,"dup":49}],255:[function(_dereq_,module,exports){ module.exports = _dereq_('react/lib/ReactCSSTransitionGroup'); -},{"react/lib/ReactCSSTransitionGroup":340}],236:[function(_dereq_,module,exports){ +},{"react/lib/ReactCSSTransitionGroup":361}],256:[function(_dereq_,module,exports){ 'use strict'; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -27690,7 +28197,7 @@ C3Wrapper.propTypes = { }; module.exports = C3Wrapper; -},{"c3":237,"react":475}],237:[function(_dereq_,module,exports){ +},{"c3":257,"react":496}],257:[function(_dereq_,module,exports){ (function (window) { 'use strict'; @@ -35894,7 +36401,7 @@ module.exports = C3Wrapper; })(window); -},{"d3":238}],238:[function(_dereq_,module,exports){ +},{"d3":258}],258:[function(_dereq_,module,exports){ !function() { var d3 = { version: "3.5.17" @@ -45449,12 +45956,12 @@ module.exports = C3Wrapper; }); if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3; }(); -},{}],239:[function(_dereq_,module,exports){ +},{}],259:[function(_dereq_,module,exports){ 'use strict'; module.exports = _dereq_('react/lib/ReactDOM'); -},{"react/lib/ReactDOM":350}],240:[function(_dereq_,module,exports){ +},{"react/lib/ReactDOM":371}],260:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45475,7 +45982,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var Gateway = (function (_React$Component) { +var Gateway = function (_React$Component) { _inherits(Gateway, _React$Component); function Gateway(props, context) { @@ -45501,7 +46008,6 @@ var Gateway = (function (_React$Component) { }; Gateway.prototype.renderIntoGatewayNode = function renderIntoGatewayNode(props) { - delete props.ref; this.gatewayRegistry.addChild(this.props.into, props.children); }; @@ -45510,7 +46016,7 @@ var Gateway = (function (_React$Component) { }; return Gateway; -})(_react2.default.Component); +}(_react2.default.Component); Gateway.contextTypes = { gatewayRegistry: _react2.default.PropTypes.instanceOf(_GatewayRegistry2.default).isRequired @@ -45520,7 +46026,7 @@ Gateway.propTypes = { children: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.element, _react2.default.PropTypes.string]) }; exports.default = Gateway; -},{"./GatewayRegistry":243,"react":475}],241:[function(_dereq_,module,exports){ +},{"./GatewayRegistry":263,"react":496}],261:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45545,7 +46051,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var GatewayDest = (function (_React$Component) { +var GatewayDest = function (_React$Component) { _inherits(GatewayDest, _React$Component); function GatewayDest(props, context) { @@ -45581,7 +46087,7 @@ var GatewayDest = (function (_React$Component) { }; return GatewayDest; -})(_react2.default.Component); +}(_react2.default.Component); GatewayDest.contextTypes = { gatewayRegistry: _react2.default.PropTypes.instanceOf(_GatewayRegistry2.default).isRequired @@ -45592,7 +46098,7 @@ GatewayDest.propTypes = { component: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.func]) }; exports.default = GatewayDest; -},{"./GatewayRegistry":243,"react":475,"react-prop-types":249}],242:[function(_dereq_,module,exports){ +},{"./GatewayRegistry":263,"react":496,"react-prop-types":269}],262:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45613,7 +46119,7 @@ function _possibleConstructorReturn(self, call) { if (!self) { throw new Referen function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } -var GatewayProvider = (function (_React$Component) { +var GatewayProvider = function (_React$Component) { _inherits(GatewayProvider, _React$Component); GatewayProvider.prototype.getChildContext = function getChildContext() { @@ -45636,7 +46142,7 @@ var GatewayProvider = (function (_React$Component) { }; return GatewayProvider; -})(_react2.default.Component); +}(_react2.default.Component); GatewayProvider.childContextTypes = { gatewayRegistry: _react2.default.PropTypes.instanceOf(_GatewayRegistry2.default).isRequired @@ -45645,14 +46151,14 @@ GatewayProvider.propTypes = { children: _react2.default.PropTypes.element }; exports.default = GatewayProvider; -},{"./GatewayRegistry":243,"react":475}],243:[function(_dereq_,module,exports){ +},{"./GatewayRegistry":263,"react":496}],263:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } -var GatewayRegistry = (function () { +var GatewayRegistry = function () { function GatewayRegistry() { _classCallCheck(this, GatewayRegistry); @@ -45697,10 +46203,10 @@ var GatewayRegistry = (function () { }; return GatewayRegistry; -})(); +}(); exports.default = GatewayRegistry; -},{}],244:[function(_dereq_,module,exports){ +},{}],264:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45723,7 +46229,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de exports.Gateway = _Gateway3.default; exports.GatewayDest = _GatewayDest3.default; exports.GatewayProvider = _GatewayProvider3.default; -},{"./Gateway":240,"./GatewayDest":241,"./GatewayProvider":242}],245:[function(_dereq_,module,exports){ +},{"./Gateway":260,"./GatewayDest":261,"./GatewayProvider":262}],265:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45764,7 +46270,7 @@ function all() { } module.exports = exports['default']; -},{"./common":246}],246:[function(_dereq_,module,exports){ +},{"./common":266}],266:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45799,7 +46305,7 @@ function createChainableTypeChecker(validate) { return chainedCheckType; } -},{}],247:[function(_dereq_,module,exports){ +},{}],267:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45833,7 +46339,7 @@ function _resetWarned() { deprecated._resetWarned = _resetWarned; module.exports = exports['default']; -},{"warning":254}],248:[function(_dereq_,module,exports){ +},{"warning":274}],268:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45875,7 +46381,7 @@ function validate(props, propName, componentName) { exports['default'] = _common.createChainableTypeChecker(validate); module.exports = exports['default']; -},{"./common":246,"react":475}],249:[function(_dereq_,module,exports){ +},{"./common":266,"react":496}],269:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45923,7 +46429,7 @@ var _deprecated2 = _dereq_('./deprecated'); var _deprecated3 = _interopRequireDefault(_deprecated2); exports.deprecated = _deprecated3['default']; -},{"./all":245,"./deprecated":247,"./elementType":248,"./isRequiredForA11y":250,"./keyOf":251,"./mountable":252,"./singlePropFrom":253}],250:[function(_dereq_,module,exports){ +},{"./all":265,"./deprecated":267,"./elementType":268,"./isRequiredForA11y":270,"./keyOf":271,"./mountable":272,"./singlePropFrom":273}],270:[function(_dereq_,module,exports){ "use strict"; exports.__esModule = true; @@ -45940,7 +46446,7 @@ function isRequiredForA11y(propType) { } module.exports = exports["default"]; -},{}],251:[function(_dereq_,module,exports){ +},{}],271:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45969,7 +46475,7 @@ function keyOf(obj) { } module.exports = exports['default']; -},{"./common":246}],252:[function(_dereq_,module,exports){ +},{"./common":266}],272:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -45997,7 +46503,7 @@ function validate(props, propName, componentName) { exports['default'] = _common.createChainableTypeChecker(validate); module.exports = exports['default']; -},{"./common":246}],253:[function(_dereq_,module,exports){ +},{"./common":266}],273:[function(_dereq_,module,exports){ /** * Checks if only one of the listed properties is in use. An error is given * if multiple have a value @@ -46036,7 +46542,7 @@ function createSinglePropFromChecker() { } module.exports = exports['default']; -},{}],254:[function(_dereq_,module,exports){ +},{}],274:[function(_dereq_,module,exports){ (function (process){ /** * Copyright 2014-2015, Facebook, Inc. @@ -46101,8 +46607,8 @@ module.exports = warning; }).call(this,_dereq_('_process')) -},{"_process":2}],255:[function(_dereq_,module,exports){ -(function (process){ +},{"_process":2}],275:[function(_dereq_,module,exports){ +(function (process,global){ /* * Copyright 2016, Yahoo Inc. * Copyrights licensed under the New BSD License. @@ -46111,6 +46617,8 @@ module.exports = warning; 'use strict'; +Object.defineProperty(exports, '__esModule', { value: true }); + function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var allLocaleData = _interopDefault(_dereq_('../locale-data/index.js')); @@ -46121,20 +46629,133 @@ var React__default = _interopDefault(React); var invariant = _interopDefault(_dereq_('invariant')); var memoizeIntlConstructor = _interopDefault(_dereq_('intl-format-cache')); -var babelHelpers = {}; -babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { +// GENERATED FILE +var defaultLocaleData = { "locale": "en", "pluralRuleFunction": function pluralRuleFunction(n, ord) { + var s = String(n).split("."), + v0 = !s[1], + t0 = Number(s[0]) == n, + n10 = t0 && s[0].slice(-1), + n100 = t0 && s[0].slice(-2);if (ord) return n10 == 1 && n100 != 11 ? "one" : n10 == 2 && n100 != 12 ? "two" : n10 == 3 && n100 != 13 ? "few" : "other";return n == 1 && v0 ? "one" : "other"; + }, "fields": { "year": { "displayName": "year", "relative": { "0": "this year", "1": "next year", "-1": "last year" }, "relativeTime": { "future": { "one": "in {0} year", "other": "in {0} years" }, "past": { "one": "{0} year ago", "other": "{0} years ago" } } }, "month": { "displayName": "month", "relative": { "0": "this month", "1": "next month", "-1": "last month" }, "relativeTime": { "future": { "one": "in {0} month", "other": "in {0} months" }, "past": { "one": "{0} month ago", "other": "{0} months ago" } } }, "day": { "displayName": "day", "relative": { "0": "today", "1": "tomorrow", "-1": "yesterday" }, "relativeTime": { "future": { "one": "in {0} day", "other": "in {0} days" }, "past": { "one": "{0} day ago", "other": "{0} days ago" } } }, "hour": { "displayName": "hour", "relativeTime": { "future": { "one": "in {0} hour", "other": "in {0} hours" }, "past": { "one": "{0} hour ago", "other": "{0} hours ago" } } }, "minute": { "displayName": "minute", "relativeTime": { "future": { "one": "in {0} minute", "other": "in {0} minutes" }, "past": { "one": "{0} minute ago", "other": "{0} minutes ago" } } }, "second": { "displayName": "second", "relative": { "0": "now" }, "relativeTime": { "future": { "one": "in {0} second", "other": "in {0} seconds" }, "past": { "one": "{0} second ago", "other": "{0} seconds ago" } } } } }; + +function addLocaleData() { + var data = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + + var locales = Array.isArray(data) ? data : [data]; + + locales.forEach(function (localeData) { + if (localeData && localeData.locale) { + IntlMessageFormat.__addLocaleData(localeData); + IntlRelativeFormat.__addLocaleData(localeData); + } + }); +} + +function hasLocaleData(locale) { + var localeParts = (locale || '').split('-'); + + while (localeParts.length > 0) { + if (hasIMFAndIRFLocaleData(localeParts.join('-'))) { + return true; + } + + localeParts.pop(); + } + + return false; +} + +function hasIMFAndIRFLocaleData(locale) { + var normalizedLocale = locale && locale.toLowerCase(); + + return !!(IntlMessageFormat.__localeData__[normalizedLocale] && IntlRelativeFormat.__localeData__[normalizedLocale]); +} + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; -babelHelpers.classCallCheck = function (instance, Constructor) { +var jsx = function () { + var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7; + return function createRawReactElement(type, props, key, children) { + var defaultProps = type && type.defaultProps; + var childrenLength = arguments.length - 3; + + if (!props && childrenLength !== 0) { + props = {}; + } + + if (props && defaultProps) { + for (var propName in defaultProps) { + if (props[propName] === void 0) { + props[propName] = defaultProps[propName]; + } + } + } else if (!props) { + props = defaultProps || {}; + } + + if (childrenLength === 1) { + props.children = children; + } else if (childrenLength > 1) { + var childArray = Array(childrenLength); + + for (var i = 0; i < childrenLength; i++) { + childArray[i] = arguments[i + 3]; + } + + props.children = childArray; + } + + return { + $$typeof: REACT_ELEMENT_TYPE, + type: type, + key: key === undefined ? null : '' + key, + ref: null, + props: props, + _owner: null + }; + }; +}(); + +var asyncToGenerator = function (fn) { + return function () { + var gen = fn.apply(this, arguments); + return new Promise(function (resolve, reject) { + function step(key, arg) { + try { + var info = gen[key](arg); + var value = info.value; + } catch (error) { + reject(error); + return; + } + + if (info.done) { + resolve(value); + } else { + return Promise.resolve(value).then(function (value) { + return step("next", value); + }, function (err) { + return step("throw", err); + }); + } + } + + return step("next"); + }); + }; +}; + +var classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; -babelHelpers.createClass = function () { +var createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; @@ -46152,7 +46773,33 @@ babelHelpers.createClass = function () { }; }(); -babelHelpers.defineProperty = function (obj, key, value) { +var defineEnumerableProperties = function (obj, descs) { + for (var key in descs) { + var desc = descs[key]; + desc.configurable = desc.enumerable = true; + if ("value" in desc) desc.writable = true; + Object.defineProperty(obj, key, desc); + } + + return obj; +}; + +var defaults = function (obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + + return obj; +}; + +var defineProperty = function (obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, @@ -46167,7 +46814,7 @@ babelHelpers.defineProperty = function (obj, key, value) { return obj; }; -babelHelpers.extends = Object.assign || function (target) { +var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; @@ -46181,7 +46828,32 @@ babelHelpers.extends = Object.assign || function (target) { return target; }; -babelHelpers.inherits = function (subClass, superClass) { +var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } +}; + +var inherits = function (subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } @@ -46197,7 +46869,48 @@ babelHelpers.inherits = function (subClass, superClass) { if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }; -babelHelpers.objectWithoutProperties = function (obj, keys) { +var _instanceof = function (left, right) { + if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { + return right[Symbol.hasInstance](left); + } else { + return left instanceof right; + } +}; + +var interopRequireDefault = function (obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +}; + +var interopRequireWildcard = function (obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + + newObj.default = obj; + return newObj; + } +}; + +var newArrowCheck = function (innerThis, boundThis) { + if (innerThis !== boundThis) { + throw new TypeError("Cannot instantiate an arrow function"); + } +}; + +var objectDestructuringEmpty = function (obj) { + if (obj == null) throw new TypeError("Cannot destructure undefined"); +}; + +var objectWithoutProperties = function (obj, keys) { var target = {}; for (var i in obj) { @@ -46209,7 +46922,7 @@ babelHelpers.objectWithoutProperties = function (obj, keys) { return target; }; -babelHelpers.possibleConstructorReturn = function (self, call) { +var possibleConstructorReturn = function (self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } @@ -46217,59 +46930,158 @@ babelHelpers.possibleConstructorReturn = function (self, call) { return call && (typeof call === "object" || typeof call === "function") ? call : self; }; -babelHelpers.toConsumableArray = function (arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; +var selfGlobal = typeof global === "undefined" ? self : global; - return arr2; +var set = function set(object, property, value, receiver) { + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent !== null) { + set(parent, property, value, receiver); + } + } else if ("value" in desc && desc.writable) { + desc.value = value; } else { - return Array.from(arr); + var setter = desc.set; + + if (setter !== undefined) { + setter.call(receiver, value); + } } + + return value; }; -babelHelpers; +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; -// GENERATED FILE -var defaultLocaleData = { "locale": "en", "pluralRuleFunction": function pluralRuleFunction(n, ord) { - var s = String(n).split("."), - v0 = !s[1], - t0 = Number(s[0]) == n, - n10 = t0 && s[0].slice(-1), - n100 = t0 && s[0].slice(-2);if (ord) return n10 == 1 && n100 != 11 ? "one" : n10 == 2 && n100 != 12 ? "two" : n10 == 3 && n100 != 13 ? "few" : "other";return n == 1 && v0 ? "one" : "other"; - }, "fields": { "year": { "displayName": "year", "relative": { "0": "this year", "1": "next year", "-1": "last year" }, "relativeTime": { "future": { "one": "in {0} year", "other": "in {0} years" }, "past": { "one": "{0} year ago", "other": "{0} years ago" } } }, "month": { "displayName": "month", "relative": { "0": "this month", "1": "next month", "-1": "last month" }, "relativeTime": { "future": { "one": "in {0} month", "other": "in {0} months" }, "past": { "one": "{0} month ago", "other": "{0} months ago" } } }, "day": { "displayName": "day", "relative": { "0": "today", "1": "tomorrow", "-1": "yesterday" }, "relativeTime": { "future": { "one": "in {0} day", "other": "in {0} days" }, "past": { "one": "{0} day ago", "other": "{0} days ago" } } }, "hour": { "displayName": "hour", "relativeTime": { "future": { "one": "in {0} hour", "other": "in {0} hours" }, "past": { "one": "{0} hour ago", "other": "{0} hours ago" } } }, "minute": { "displayName": "minute", "relativeTime": { "future": { "one": "in {0} minute", "other": "in {0} minutes" }, "past": { "one": "{0} minute ago", "other": "{0} minutes ago" } } }, "second": { "displayName": "second", "relative": { "0": "now" }, "relativeTime": { "future": { "one": "in {0} second", "other": "in {0} seconds" }, "past": { "one": "{0} second ago", "other": "{0} seconds ago" } } } } }; + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); -function addLocaleData() { - var data = arguments.length <= 0 || arguments[0] === undefined ? [] : arguments[0]; + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } - var locales = Array.isArray(data) ? data : [data]; + return _arr; + } - locales.forEach(function (localeData) { - if (localeData && localeData.locale) { - IntlMessageFormat.__addLocaleData(localeData); - IntlRelativeFormat.__addLocaleData(localeData); - } - }); -} + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); -function hasLocaleData(locale) { - var localeParts = (locale || '').split('-'); +var slicedToArrayLoose = function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + var _arr = []; - while (localeParts.length > 0) { - if (hasIMFAndIRFLocaleData(localeParts.join('-'))) { - return true; - } + for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) { + _arr.push(_step.value); - localeParts.pop(); + if (i && _arr.length === i) break; } - return false; -} + return _arr; + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } +}; -function hasIMFAndIRFLocaleData(locale) { - var normalizedLocale = locale && locale.toLowerCase(); +var taggedTemplateLiteral = function (strings, raw) { + return Object.freeze(Object.defineProperties(strings, { + raw: { + value: Object.freeze(raw) + } + })); +}; - return !!(IntlMessageFormat.__localeData__[normalizedLocale] && IntlRelativeFormat.__localeData__[normalizedLocale]); -} +var taggedTemplateLiteralLoose = function (strings, raw) { + strings.raw = raw; + return strings; +}; + +var temporalRef = function (val, name, undef) { + if (val === undef) { + throw new ReferenceError(name + " is not defined - temporal dead zone"); + } else { + return val; + } +}; + +var temporalUndefined = {}; + +var toArray = function (arr) { + return Array.isArray(arr) ? arr : Array.from(arr); +}; + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + + + +var babelHelpers$1 = Object.freeze({ + _typeof: _typeof, + jsx: jsx, + asyncToGenerator: asyncToGenerator, + classCallCheck: classCallCheck, + createClass: createClass, + defineEnumerableProperties: defineEnumerableProperties, + defaults: defaults, + defineProperty: defineProperty, + _extends: _extends, + get: get, + inherits: inherits, + _instanceof: _instanceof, + interopRequireDefault: interopRequireDefault, + interopRequireWildcard: interopRequireWildcard, + newArrowCheck: newArrowCheck, + objectDestructuringEmpty: objectDestructuringEmpty, + objectWithoutProperties: objectWithoutProperties, + possibleConstructorReturn: possibleConstructorReturn, + selfGlobal: selfGlobal, + set: set, + slicedToArray: slicedToArray, + slicedToArrayLoose: slicedToArrayLoose, + taggedTemplateLiteral: taggedTemplateLiteral, + taggedTemplateLiteralLoose: taggedTemplateLiteralLoose, + temporalRef: temporalRef, + temporalUndefined: temporalUndefined, + toArray: toArray, + toConsumableArray: toConsumableArray, + typeof: _typeof, + extends: _extends, + instanceof: _instanceof +}); var bool = React.PropTypes.bool; var number = React.PropTypes.number; @@ -46299,7 +47111,7 @@ var intlFormatPropTypes = { formatHTMLMessage: func.isRequired }; -var intlShape = shape(babelHelpers['extends']({}, intlConfigPropTypes, intlFormatPropTypes, { +var intlShape = shape(babelHelpers$1['extends']({}, intlConfigPropTypes, intlFormatPropTypes, { formatters: object, now: func.isRequired })); @@ -46397,7 +47209,7 @@ function shallowEquals(objA, objB) { return true; } - if ((typeof objA === 'undefined' ? 'undefined' : babelHelpers['typeof'](objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : babelHelpers['typeof'](objB)) !== 'object' || objB === null) { + if ((typeof objA === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](objA)) !== 'object' || objA === null || (typeof objB === 'undefined' ? 'undefined' : babelHelpers$1['typeof'](objB)) !== 'object' || objB === null) { return false; } @@ -46446,18 +47258,18 @@ function injectIntl(WrappedComponent) { var withRef = _options$withRef === undefined ? false : _options$withRef; var InjectIntl = function (_Component) { - babelHelpers.inherits(InjectIntl, _Component); + inherits(InjectIntl, _Component); function InjectIntl(props, context) { - babelHelpers.classCallCheck(this, InjectIntl); + classCallCheck(this, InjectIntl); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(InjectIntl).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(InjectIntl).call(this, props, context)); invariantIntlContext(context); return _this; } - babelHelpers.createClass(InjectIntl, [{ + createClass(InjectIntl, [{ key: 'getWrappedInstance', value: function getWrappedInstance() { invariant(withRef, '[React Intl] To access the wrapped instance, ' + 'the `{withRef: true}` option must be set when calling: ' + '`injectIntl()`'); @@ -46467,7 +47279,7 @@ function injectIntl(WrappedComponent) { }, { key: 'render', value: function render() { - return React__default.createElement(WrappedComponent, babelHelpers['extends']({}, this.props, babelHelpers.defineProperty({}, intlPropName, this.context.intl), { + return React__default.createElement(WrappedComponent, babelHelpers$1['extends']({}, this.props, defineProperty({}, intlPropName, this.context.intl), { ref: withRef ? 'wrappedInstance' : null })); } @@ -46510,7 +47322,7 @@ function findPluralFunction(locale) { var IntlPluralFormat = function IntlPluralFormat(locales) { var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; - babelHelpers.classCallCheck(this, IntlPluralFormat); + classCallCheck(this, IntlPluralFormat); var useOrdinal = options.style === 'ordinal'; var pluralFn = findPluralFunction(resolveLocale(locales)); @@ -46620,7 +47432,7 @@ function formatRelative(config, state, value) { // Capture the current threshold values, then temporarily override them with // specific values just for this render. - var oldThresholds = babelHelpers['extends']({}, IntlRelativeFormat.thresholds); + var oldThresholds = babelHelpers$1['extends']({}, IntlRelativeFormat.thresholds); updateRelativeFormatThresholds(RELATIVE_FORMAT_THRESHOLDS); try { @@ -46761,6 +47573,8 @@ function formatHTMLMessage(config, state, messageDescriptor) { return formatMessage(config, state, messageDescriptor, escapedValues); } + + var format = Object.freeze({ formatDate: formatDate, formatTime: formatTime, @@ -46785,12 +47599,12 @@ var defaultProps = { }; var IntlProvider = function (_Component) { - babelHelpers.inherits(IntlProvider, _Component); + inherits(IntlProvider, _Component); function IntlProvider(props, context) { - babelHelpers.classCallCheck(this, IntlProvider); + classCallCheck(this, IntlProvider); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(IntlProvider).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(IntlProvider).call(this, props, context)); invariant(typeof Intl !== 'undefined', '[React Intl] The `Intl` APIs must be available in the runtime, ' + 'and do not appear to be built-in. An `Intl` polyfill should be loaded.\n' + 'See: http://formatjs.io/guides/runtime-environments/'); @@ -46826,7 +47640,7 @@ var IntlProvider = function (_Component) { } : _ref$formatters; - _this.state = babelHelpers['extends']({}, formatters, { + _this.state = babelHelpers$1['extends']({}, formatters, { // Wrapper to provide stable "now" time for initial render. now: function now() { @@ -46836,7 +47650,7 @@ var IntlProvider = function (_Component) { return _this; } - babelHelpers.createClass(IntlProvider, [{ + createClass(IntlProvider, [{ key: 'getConfig', value: function getConfig() { var intlContext = this.context.intl; @@ -46871,7 +47685,7 @@ var IntlProvider = function (_Component) { // The `messages` are overridden to the `defaultProps` empty object // to maintain referential equality across re-renders. It's assumed // each contains a `defaultMessage` prop. - config = babelHelpers['extends']({}, config, { + config = babelHelpers$1['extends']({}, config, { locale: defaultLocale, formats: defaultFormats, messages: defaultProps.messages @@ -46898,11 +47712,11 @@ var IntlProvider = function (_Component) { var _state = this.state; var now = _state.now; - var formatters = babelHelpers.objectWithoutProperties(_state, ['now']); + var formatters = objectWithoutProperties(_state, ['now']); return { - intl: babelHelpers['extends']({}, config, boundFormatFns, { + intl: babelHelpers$1['extends']({}, config, boundFormatFns, { formatters: formatters, now: now }) @@ -46941,24 +47755,24 @@ IntlProvider.childContextTypes = { intl: intlShape.isRequired }; -IntlProvider.propTypes = babelHelpers['extends']({}, intlConfigPropTypes, { +IntlProvider.propTypes = babelHelpers$1['extends']({}, intlConfigPropTypes, { children: React.PropTypes.element.isRequired, initialNow: React.PropTypes.any }); var FormattedDate = function (_Component) { - babelHelpers.inherits(FormattedDate, _Component); + inherits(FormattedDate, _Component); function FormattedDate(props, context) { - babelHelpers.classCallCheck(this, FormattedDate); + classCallCheck(this, FormattedDate); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(FormattedDate).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(FormattedDate).call(this, props, context)); invariantIntlContext(context); return _this; } - babelHelpers.createClass(FormattedDate, [{ + createClass(FormattedDate, [{ key: 'shouldComponentUpdate', value: function shouldComponentUpdate() { for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) { @@ -46998,25 +47812,25 @@ FormattedDate.contextTypes = { intl: intlShape }; -FormattedDate.propTypes = babelHelpers['extends']({}, dateTimeFormatPropTypes, { +FormattedDate.propTypes = babelHelpers$1['extends']({}, dateTimeFormatPropTypes, { value: React.PropTypes.any.isRequired, format: React.PropTypes.string, children: React.PropTypes.func }); var FormattedTime = function (_Component) { - babelHelpers.inherits(FormattedTime, _Component); + inherits(FormattedTime, _Component); function FormattedTime(props, context) { - babelHelpers.classCallCheck(this, FormattedTime); + classCallCheck(this, FormattedTime); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(FormattedTime).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(FormattedTime).call(this, props, context)); invariantIntlContext(context); return _this; } - babelHelpers.createClass(FormattedTime, [{ + createClass(FormattedTime, [{ key: 'shouldComponentUpdate', value: function shouldComponentUpdate() { for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) { @@ -47056,7 +47870,7 @@ FormattedTime.contextTypes = { intl: intlShape }; -FormattedTime.propTypes = babelHelpers['extends']({}, dateTimeFormatPropTypes, { +FormattedTime.propTypes = babelHelpers$1['extends']({}, dateTimeFormatPropTypes, { value: React.PropTypes.any.isRequired, format: React.PropTypes.string, children: React.PropTypes.func @@ -47106,13 +47920,24 @@ function getUnitDelay(units) { } } +function isSameDate(a, b) { + if (a === b) { + return true; + } + + var aTime = new Date(a).getTime(); + var bTime = new Date(b).getTime(); + + return isFinite(aTime) && isFinite(bTime) && aTime === bTime; +} + var FormattedRelative = function (_Component) { - babelHelpers.inherits(FormattedRelative, _Component); + inherits(FormattedRelative, _Component); function FormattedRelative(props, context) { - babelHelpers.classCallCheck(this, FormattedRelative); + classCallCheck(this, FormattedRelative); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(FormattedRelative).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(FormattedRelative).call(this, props, context)); invariantIntlContext(context); @@ -47124,7 +47949,7 @@ var FormattedRelative = function (_Component) { return _this; } - babelHelpers.createClass(FormattedRelative, [{ + createClass(FormattedRelative, [{ key: 'scheduleNextUpdate', value: function scheduleNextUpdate(props, state) { var _this2 = this; @@ -47157,6 +47982,22 @@ var FormattedRelative = function (_Component) { _this2.setState({ now: _this2.context.intl.now() }); }, delay); } + }, { + key: 'componentDidMount', + value: function componentDidMount() { + this.scheduleNextUpdate(this.props, this.state); + } + }, { + key: 'componentWillReceiveProps', + value: function componentWillReceiveProps(_ref) { + var nextValue = _ref.value; + + // When the `props.value` date changes, `state.now` needs to be updated, + // and the next update can be rescheduled. + if (!isSameDate(nextValue, this.props.value)) { + this.setState({ now: this.context.intl.now() }); + } + } }, { key: 'shouldComponentUpdate', value: function shouldComponentUpdate() { @@ -47171,11 +48012,6 @@ var FormattedRelative = function (_Component) { value: function componentWillUpdate(nextProps, nextState) { this.scheduleNextUpdate(nextProps, nextState); } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - this.scheduleNextUpdate(this.props, this.state); - } }, { key: 'componentWillUnmount', value: function componentWillUnmount() { @@ -47190,7 +48026,7 @@ var FormattedRelative = function (_Component) { var children = _props.children; - var formattedRelative = formatRelative(value, babelHelpers['extends']({}, this.props, this.state)); + var formattedRelative = formatRelative(value, babelHelpers$1['extends']({}, this.props, this.state)); if (typeof children === 'function') { return children(formattedRelative); @@ -47212,7 +48048,7 @@ FormattedRelative.contextTypes = { intl: intlShape }; -FormattedRelative.propTypes = babelHelpers['extends']({}, relativeFormatPropTypes, { +FormattedRelative.propTypes = babelHelpers$1['extends']({}, relativeFormatPropTypes, { value: React.PropTypes.any.isRequired, format: React.PropTypes.string, updateInterval: React.PropTypes.number, @@ -47225,18 +48061,18 @@ FormattedRelative.defaultProps = { }; var FormattedNumber = function (_Component) { - babelHelpers.inherits(FormattedNumber, _Component); + inherits(FormattedNumber, _Component); function FormattedNumber(props, context) { - babelHelpers.classCallCheck(this, FormattedNumber); + classCallCheck(this, FormattedNumber); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(FormattedNumber).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(FormattedNumber).call(this, props, context)); invariantIntlContext(context); return _this; } - babelHelpers.createClass(FormattedNumber, [{ + createClass(FormattedNumber, [{ key: 'shouldComponentUpdate', value: function shouldComponentUpdate() { for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) { @@ -47276,25 +48112,25 @@ FormattedNumber.contextTypes = { intl: intlShape }; -FormattedNumber.propTypes = babelHelpers['extends']({}, numberFormatPropTypes, { +FormattedNumber.propTypes = babelHelpers$1['extends']({}, numberFormatPropTypes, { value: React.PropTypes.any.isRequired, format: React.PropTypes.string, children: React.PropTypes.func }); var FormattedPlural = function (_Component) { - babelHelpers.inherits(FormattedPlural, _Component); + inherits(FormattedPlural, _Component); function FormattedPlural(props, context) { - babelHelpers.classCallCheck(this, FormattedPlural); + classCallCheck(this, FormattedPlural); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(FormattedPlural).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(FormattedPlural).call(this, props, context)); invariantIntlContext(context); return _this; } - babelHelpers.createClass(FormattedPlural, [{ + createClass(FormattedPlural, [{ key: 'shouldComponentUpdate', value: function shouldComponentUpdate() { for (var _len = arguments.length, next = Array(_len), _key = 0; _key < _len; _key++) { @@ -47336,7 +48172,7 @@ FormattedPlural.contextTypes = { intl: intlShape }; -FormattedPlural.propTypes = babelHelpers['extends']({}, pluralFormatPropTypes, { +FormattedPlural.propTypes = babelHelpers$1['extends']({}, pluralFormatPropTypes, { value: React.PropTypes.any.isRequired, other: React.PropTypes.node.isRequired, @@ -47354,18 +48190,18 @@ FormattedPlural.defaultProps = { }; var FormattedMessage = function (_Component) { - babelHelpers.inherits(FormattedMessage, _Component); + inherits(FormattedMessage, _Component); function FormattedMessage(props, context) { - babelHelpers.classCallCheck(this, FormattedMessage); + classCallCheck(this, FormattedMessage); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(FormattedMessage).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(FormattedMessage).call(this, props, context)); invariantIntlContext(context); return _this; } - babelHelpers.createClass(FormattedMessage, [{ + createClass(FormattedMessage, [{ key: 'shouldComponentUpdate', value: function shouldComponentUpdate(nextProps) { var values = this.props.values; @@ -47379,7 +48215,7 @@ var FormattedMessage = function (_Component) { // Since `values` has already been checked, we know they're not // different, so the current `values` are carried over so the shallow // equals comparison on the other props isn't affected by the `values`. - var nextPropsToCheck = babelHelpers['extends']({}, nextProps, { + var nextPropsToCheck = babelHelpers$1['extends']({}, nextProps, { values: values }); @@ -47467,10 +48303,10 @@ var FormattedMessage = function (_Component) { } if (typeof children === 'function') { - return children.apply(undefined, babelHelpers.toConsumableArray(nodes)); + return children.apply(undefined, toConsumableArray(nodes)); } - return React.createElement.apply(undefined, [tagName, null].concat(babelHelpers.toConsumableArray(nodes))); + return React.createElement.apply(undefined, [tagName, null].concat(toConsumableArray(nodes))); } }]); return FormattedMessage; @@ -47482,7 +48318,7 @@ FormattedMessage.contextTypes = { intl: intlShape }; -FormattedMessage.propTypes = babelHelpers['extends']({}, messageDescriptorPropTypes, { +FormattedMessage.propTypes = babelHelpers$1['extends']({}, messageDescriptorPropTypes, { values: React.PropTypes.object, tagName: React.PropTypes.string, children: React.PropTypes.func @@ -47494,18 +48330,18 @@ FormattedMessage.defaultProps = { }; var FormattedHTMLMessage = function (_Component) { - babelHelpers.inherits(FormattedHTMLMessage, _Component); + inherits(FormattedHTMLMessage, _Component); function FormattedHTMLMessage(props, context) { - babelHelpers.classCallCheck(this, FormattedHTMLMessage); + classCallCheck(this, FormattedHTMLMessage); - var _this = babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(FormattedHTMLMessage).call(this, props, context)); + var _this = possibleConstructorReturn(this, Object.getPrototypeOf(FormattedHTMLMessage).call(this, props, context)); invariantIntlContext(context); return _this; } - babelHelpers.createClass(FormattedHTMLMessage, [{ + createClass(FormattedHTMLMessage, [{ key: 'shouldComponentUpdate', value: function shouldComponentUpdate(nextProps) { var values = this.props.values; @@ -47519,7 +48355,7 @@ var FormattedHTMLMessage = function (_Component) { // Since `values` has already been checked, we know they're not // different, so the current `values` are carried over so the shallow // equals comparison on the other props isn't affected by the `values`. - var nextPropsToCheck = babelHelpers['extends']({}, nextProps, { + var nextPropsToCheck = babelHelpers$1['extends']({}, nextProps, { values: values }); @@ -47573,7 +48409,7 @@ FormattedHTMLMessage.contextTypes = { intl: intlShape }; -FormattedHTMLMessage.propTypes = babelHelpers['extends']({}, messageDescriptorPropTypes, { +FormattedHTMLMessage.propTypes = babelHelpers$1['extends']({}, messageDescriptorPropTypes, { values: React.PropTypes.object, tagName: React.PropTypes.string, children: React.PropTypes.func @@ -47600,15 +48436,15 @@ exports.FormattedNumber = FormattedNumber; exports.FormattedPlural = FormattedPlural; exports.FormattedMessage = FormattedMessage; exports.FormattedHTMLMessage = FormattedHTMLMessage; -}).call(this,_dereq_('_process')) +}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../locale-data/index.js":1,"_process":2,"intl-format-cache":256,"intl-messageformat":259,"intl-relativeformat":268,"invariant":274,"react":475}],256:[function(_dereq_,module,exports){ +},{"../locale-data/index.js":1,"_process":2,"intl-format-cache":276,"intl-messageformat":279,"intl-relativeformat":288,"invariant":294,"react":496}],276:[function(_dereq_,module,exports){ 'use strict'; exports = module.exports = _dereq_('./lib/memoizer')['default']; exports['default'] = exports; -},{"./lib/memoizer":258}],257:[function(_dereq_,module,exports){ +},{"./lib/memoizer":278}],277:[function(_dereq_,module,exports){ "use strict"; /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. @@ -47688,7 +48524,7 @@ var objCreate = Object.create || function (proto, props) { exports.bind = bind, exports.defineProperty = defineProperty, exports.objCreate = objCreate; -},{}],258:[function(_dereq_,module,exports){ +},{}],278:[function(_dereq_,module,exports){ "use strict"; var src$es5$$ = _dereq_("./es5"); exports["default"] = createFormatCache; @@ -47764,7 +48600,7 @@ function orderedProps(obj) { } -},{"./es5":257}],259:[function(_dereq_,module,exports){ +},{"./es5":277}],279:[function(_dereq_,module,exports){ /* jshint node:true */ 'use strict'; @@ -47781,7 +48617,7 @@ _dereq_('./lib/locales'); exports = module.exports = IntlMessageFormat; exports['default'] = exports; -},{"./lib/locales":1,"./lib/main":264}],260:[function(_dereq_,module,exports){ +},{"./lib/locales":1,"./lib/main":284}],280:[function(_dereq_,module,exports){ /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. @@ -47991,7 +48827,7 @@ SelectFormat.prototype.getOption = function (value) { }; -},{}],261:[function(_dereq_,module,exports){ +},{}],281:[function(_dereq_,module,exports){ /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. @@ -48256,13 +49092,13 @@ MessageFormat.prototype._resolveLocale = function (locales) { }; -},{"./compiler":260,"./es5":263,"./utils":265,"intl-messageformat-parser":266}],262:[function(_dereq_,module,exports){ +},{"./compiler":280,"./es5":283,"./utils":285,"intl-messageformat-parser":286}],282:[function(_dereq_,module,exports){ // GENERATED FILE "use strict"; exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}}; -},{}],263:[function(_dereq_,module,exports){ +},{}],283:[function(_dereq_,module,exports){ /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. @@ -48312,7 +49148,7 @@ var objCreate = Object.create || function (proto, props) { exports.defineProperty = defineProperty, exports.objCreate = objCreate; -},{"./utils":265}],264:[function(_dereq_,module,exports){ +},{"./utils":285}],284:[function(_dereq_,module,exports){ /* jslint esnext: true */ "use strict"; @@ -48324,7 +49160,7 @@ src$core$$["default"].defaultLocale = 'en'; exports["default"] = src$core$$["default"]; -},{"./core":261,"./en":262}],265:[function(_dereq_,module,exports){ +},{"./core":281,"./en":282}],285:[function(_dereq_,module,exports){ /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. @@ -48357,13 +49193,13 @@ function extend(obj) { exports.hop = hop; -},{}],266:[function(_dereq_,module,exports){ +},{}],286:[function(_dereq_,module,exports){ 'use strict'; exports = module.exports = _dereq_('./lib/parser')['default']; exports['default'] = exports; -},{"./lib/parser":267}],267:[function(_dereq_,module,exports){ +},{"./lib/parser":287}],287:[function(_dereq_,module,exports){ "use strict"; exports["default"] = (function() { @@ -49723,7 +50559,7 @@ exports["default"] = (function() { })(); -},{}],268:[function(_dereq_,module,exports){ +},{}],288:[function(_dereq_,module,exports){ /* jshint node:true */ 'use strict'; @@ -49740,7 +50576,7 @@ _dereq_('./lib/locales'); exports = module.exports = IntlRelativeFormat; exports['default'] = exports; -},{"./lib/locales":1,"./lib/main":273}],269:[function(_dereq_,module,exports){ +},{"./lib/locales":1,"./lib/main":293}],289:[function(_dereq_,module,exports){ /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. @@ -50038,7 +50874,7 @@ RelativeFormat.prototype._selectUnits = function (diffReport) { }; -},{"./diff":270,"./es5":272,"intl-messageformat":259}],270:[function(_dereq_,module,exports){ +},{"./diff":290,"./es5":292,"intl-messageformat":279}],290:[function(_dereq_,module,exports){ /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. @@ -50085,13 +50921,13 @@ exports["default"] = function (from, to) { }; -},{}],271:[function(_dereq_,module,exports){ +},{}],291:[function(_dereq_,module,exports){ // GENERATED FILE "use strict"; exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"},"fields":{"year":{"displayName":"year","relative":{"0":"this year","1":"next year","-1":"last year"},"relativeTime":{"future":{"one":"in {0} year","other":"in {0} years"},"past":{"one":"{0} year ago","other":"{0} years ago"}}},"month":{"displayName":"month","relative":{"0":"this month","1":"next month","-1":"last month"},"relativeTime":{"future":{"one":"in {0} month","other":"in {0} months"},"past":{"one":"{0} month ago","other":"{0} months ago"}}},"day":{"displayName":"day","relative":{"0":"today","1":"tomorrow","-1":"yesterday"},"relativeTime":{"future":{"one":"in {0} day","other":"in {0} days"},"past":{"one":"{0} day ago","other":"{0} days ago"}}},"hour":{"displayName":"hour","relativeTime":{"future":{"one":"in {0} hour","other":"in {0} hours"},"past":{"one":"{0} hour ago","other":"{0} hours ago"}}},"minute":{"displayName":"minute","relativeTime":{"future":{"one":"in {0} minute","other":"in {0} minutes"},"past":{"one":"{0} minute ago","other":"{0} minutes ago"}}},"second":{"displayName":"second","relative":{"0":"now"},"relativeTime":{"future":{"one":"in {0} second","other":"in {0} seconds"},"past":{"one":"{0} second ago","other":"{0} seconds ago"}}}}}; -},{}],272:[function(_dereq_,module,exports){ +},{}],292:[function(_dereq_,module,exports){ /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. @@ -50167,9 +51003,9 @@ var dateNow = Date.now || function () { exports.defineProperty = defineProperty, exports.objCreate = objCreate, exports.arrIndexOf = arrIndexOf, exports.isArray = isArray, exports.dateNow = dateNow; -},{}],273:[function(_dereq_,module,exports){ -arguments[4][264][0].apply(exports,arguments) -},{"./core":269,"./en":271,"dup":264}],274:[function(_dereq_,module,exports){ +},{}],293:[function(_dereq_,module,exports){ +arguments[4][284][0].apply(exports,arguments) +},{"./core":289,"./en":291,"dup":284}],294:[function(_dereq_,module,exports){ (function (process){ /** * Copyright 2013-2015, Facebook, Inc. @@ -50225,7 +51061,7 @@ module.exports = invariant; }).call(this,_dereq_('_process')) -},{"_process":2}],275:[function(_dereq_,module,exports){ +},{"_process":2}],295:[function(_dereq_,module,exports){ (function (process){ 'use strict'; @@ -50307,7 +51143,7 @@ Provider.childContextTypes = { }; }).call(this,_dereq_('_process')) -},{"../utils/storeShape":279,"../utils/warning":280,"_process":2,"react":475}],276:[function(_dereq_,module,exports){ +},{"../utils/storeShape":299,"../utils/warning":300,"_process":2,"react":496}],296:[function(_dereq_,module,exports){ (function (process){ 'use strict'; @@ -50704,7 +51540,7 @@ function connect(mapStateToProps, mapDispatchToProps, mergeProps) { } }).call(this,_dereq_('_process')) -},{"../utils/shallowEqual":278,"../utils/storeShape":279,"../utils/warning":280,"../utils/wrapActionCreators":281,"_process":2,"hoist-non-react-statics":282,"invariant":283,"lodash/isPlainObject":287,"react":475}],277:[function(_dereq_,module,exports){ +},{"../utils/shallowEqual":298,"../utils/storeShape":299,"../utils/warning":300,"../utils/wrapActionCreators":301,"_process":2,"hoist-non-react-statics":302,"invariant":303,"lodash/isPlainObject":308,"react":496}],297:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -50722,7 +51558,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "d exports.Provider = _Provider2["default"]; exports.connect = _connect2["default"]; -},{"./components/Provider":275,"./components/connect":276}],278:[function(_dereq_,module,exports){ +},{"./components/Provider":295,"./components/connect":296}],298:[function(_dereq_,module,exports){ "use strict"; exports.__esModule = true; @@ -50749,7 +51585,7 @@ function shallowEqual(objA, objB) { return true; } -},{}],279:[function(_dereq_,module,exports){ +},{}],299:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -50761,7 +51597,7 @@ exports["default"] = _react.PropTypes.shape({ dispatch: _react.PropTypes.func.isRequired, getState: _react.PropTypes.func.isRequired }); -},{"react":475}],280:[function(_dereq_,module,exports){ +},{"react":496}],300:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -50786,7 +51622,7 @@ function warning(message) { } catch (e) {} /* eslint-enable no-empty */ } -},{}],281:[function(_dereq_,module,exports){ +},{}],301:[function(_dereq_,module,exports){ 'use strict'; exports.__esModule = true; @@ -50799,7 +51635,7 @@ function wrapActionCreators(actionCreators) { return (0, _redux.bindActionCreators)(actionCreators, dispatch); }; } -},{"redux":484}],282:[function(_dereq_,module,exports){ +},{"redux":505}],302:[function(_dereq_,module,exports){ /** * Copyright 2015, Yahoo! Inc. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. @@ -50826,11 +51662,19 @@ var KNOWN_STATICS = { arity: true }; -module.exports = function hoistNonReactStatics(targetComponent, sourceComponent) { +var isGetOwnPropertySymbolsAvailable = typeof Object.getOwnPropertySymbols === 'function'; + +module.exports = function hoistNonReactStatics(targetComponent, sourceComponent, customStatics) { if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components var keys = Object.getOwnPropertyNames(sourceComponent); - for (var i=0; i=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-06-10 09:48:41" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -432,39 +523,39 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2016-06-10 07:14:17" }, { "name": "phpspec/prophecy", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -497,7 +588,7 @@ "spy", "stub" ], - "time": "2016-02-15 07:46:21" + "time": "2016-06-07 08:13:47" }, { "name": "phpunit/php-code-coverage", @@ -651,21 +742,24 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.7", + "version": "1.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "type": "library", "autoload": { "classmap": [ @@ -688,7 +782,7 @@ "keywords": [ "timer" ], - "time": "2015-06-21 08:01:12" + "time": "2016-05-12 18:03:57" }, { "name": "phpunit/php-token-stream", @@ -741,16 +835,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.24", + "version": "4.8.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e" + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90", + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90", "shasum": "" }, "require": { @@ -764,7 +858,7 @@ "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", @@ -809,7 +903,7 @@ "testing", "xunit" ], - "time": "2016-03-14 06:16:08" + "time": "2016-07-21 06:48:14" }, { "name": "phpunit/phpunit-mock-objects", @@ -985,16 +1079,16 @@ }, { "name": "sebastian/environment", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", "shasum": "" }, "require": { @@ -1031,20 +1125,20 @@ "environment", "hhvm" ], - "time": "2016-02-26 18:40:46" + "time": "2016-05-17 03:18:57" }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -1052,12 +1146,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -1097,7 +1192,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -1240,19 +1335,20 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.5.1", + "version": "2.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8" + "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6731851d6aaf1d0d6c58feff1065227b7fda3ba8", - "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4edb770cb853def6e60c93abb088ad5ac2010c83", + "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83", "shasum": "" }, "require": { + "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.1.2" @@ -1313,7 +1409,57 @@ "phpcs", "standards" ], - "time": "2016-01-19 23:39:10" + "time": "2016-07-13 23:29:13" + }, + { + "name": "webmozart/assert", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-08-09 15:02:57" } ], "aliases": [], diff --git a/config.js b/config.js index 6a7191b5..7fc93362 100644 --- a/config.js +++ b/config.js @@ -14,6 +14,12 @@ "featureManagerIsScanEnabled": false, "featureManagerIsSecurityLevelEnabled": true, "featureManagerIsSSLEnabled": false, + "useHostAPILogin": true, + "homePageCards": ["DNSManagementPage"], + "moreSettingsCards": { + "container.moresettings.security": ["SecurityLevelCard", "ChallengePassageCard", "BrowserIntegrityCheckCard"], + "container.moresettings.speed": ["AlwaysOnlineCard", "IPV6Card", "CacheLevelCard", "MinifyCard", "RailgunCard", "DevelopmentModeCard", "BrowserCacheTTLCard", "PurgeCacheCard"] + }, "locale": "en", "integrationName": "cpanel", "version": "6.0.5" diff --git a/lang/en.js b/lang/en.js index ed51163b..f51754b4 100644 --- a/lang/en.js +++ b/lang/en.js @@ -1,4 +1,12 @@ { + "component.clientLogin.form.email": "Email", + "component.clientLogin.form.apiKeyHelp": "Where can I find my API key?", + "component.clientLogin.form.apiKey": "API Key", + "component.clientLogin.form.button": "Save API Credentials", + "component.clientLogin.form.signUp": "Sign up", + "component.clientLogin.form.title": "Enter CloudFlare API Credentials", + "component.clientLogin.cloudflare.description": "New to CloudFlare? Sign up at", + "component.customcardcontrol.upgrade": "Upgrade to", "component.login.form.email": "Email", "component.login.form.forgotPassword": "Forgot your password?", "component.login.form.password": "Password", @@ -21,6 +29,9 @@ "container.activationCheckCard.title": "Activation Check", "container.activationCheckCard.status": "Status: {status}", "container.activationCheckCard.success": "Your domain is now queued up to be rescanned. Please check back in a few hours.", + "container.advanceddos.title": "Advance DDoS", + "container.advanceddos.description": "CloudFlare will stand in front of your website regardless of attack size or duration.", + "container.advanceddos.value": "Visit Cloudflare.com", "container.alwaysOnlineCard.title": "Always Online™", "container.alwaysOnlineCard.description": "If your server goes down, CloudFlare will serve your website's static pages from our cache.", "containers.analyticsPage.cached": "Cached", @@ -33,6 +44,16 @@ "container.analyticsPage.tabs.threats": "Threats", "container.analyticsPage.title": "Analytics", "container.App.version": "Version: {version}", + "container.applydefaultsettingscard.title": "Apply Default Settings", + "container.applydefaultsettingscard.description": "We recommend you to use default settings", + "container.applydefaultsettingscard.button": "Apply", + "container.applydefaultsettingscard.success": "Your default settings have been successfully set.", + "container.applydefaultsettingscard.modal.title": "Are you sure?", + "container.applydefaultsettingscard.modal.description": "Applying default settings will overwrite some of the settings you've set through Cloudflare Dashboard.", + "container.applydefaultsettingscard.modal.buttonCancel": "Cancel", + "container.applydefaultsettingscard.modal.button": "I'm sure", + "container.appNavigation.home": "Home", + "container.appNavigation.moresettings": "More Settings", "container.appNavigation.domainsOverview": "Domains Overview", "container.appNavigation.analytics": "Analytics", "container.appNavigation.performance": "Performance", @@ -98,19 +119,38 @@ "container.dnsManagementPage.thead.changePlan": "Change", "container.ipv6Card.title": "IPv6 Compatibility", "container.ipv6Card.description": "Enable IPv6 support and gateway.", + "container.homePage.title": "Home", "container.minifyCard.title": "Auto Minify", "container.minifyCard.description": "Reduce the file size of source code on your website.", "container.minifyCard.css": "CSS", "container.minifyCard.html": "HTML", "container.minifyCard.javascript": "JavaScript", + "container.moresettings.speed": "Speed", + "container.moresettings.security": "Security", "container.performancePage.title": "Performance", + "container.pluginSpecificCacheCard.title": "Automatic Cache Management", + "container.pluginSpecificCacheCard.description": "Purge CloudFlare cache automatically on updating site appearance.", + "container.pluginSpecificCacheCard.button.enable": "Enable", + "container.pluginSpecificCacheCard.button.disable": "Disable", + "container.pluginSpecificCacheCard.modal.title": "Confirm Enabling Automatic Cache", + "container.pluginSpecificCacheCard.modal.description": "Enabling automatic cache purge will clear the entire CloudFlare cache when your site appearance is updated", + "container.pluginSpecificCacheCard.modal.button": "I'm sure", + "container.pluginSpecificCacheCard.modal.buttonCancel": "Cancel", + "container.protocolRewrite.title": "Protocol Rewriting", + "container.protocolRewrite.description": "Protocol rewriting in this context convert links within your WordPress site to images, stylesheets, and scripts from using either \"http://\" or \"https://\" to using just \"//\". This rewrite tells your browser to load all of these assets using the same protocol as the base page loaded.", + "container.purgeCacheCard.dropdown": "Purge Cache", "container.purgeCacheCard.button": "Purge Everything", "container.purgeCacheCard.title": "Purge Cache", - "container.purgeCacheCard.description": "Clear cached files to force CloudFlare to fetch a fresh version of those files from your web server.", + "container.purgeCacheCard.description": "Clear cached files to force CloudFlare to fetch a fresh version of those files from your web server. You can purge files selectively or all at once.", "container.purgeCacheCard.success": "Cache was successfully purged.", "container.purgeCacheCard.modal.title" : "Confirm Purge All", "container.purgeCacheCard.modal.description": "Note: Purging your cache may slow your website temporarily.", "container.purgeCacheCard.modal.buttonCancel": "Cancel", + "container.purgeCacheByURLCard.button": "Purge Individual Files", + "container.purgeCacheByURLCard.success": "Successfully requested 1 file(s) to be purged. Please allow up to 30 seconds for changes to take effect.", + "container.purgeCacheByURLCard.modal.title" : "Confirm Individual Files", + "container.purgeCacheByURLCard.modal.description": "You can purge up to 30 files at a time. Note: Wildcards are not supported with single file purge at this time. You will need to specify the full path to the file. Separate URL(s) with spaces, or list one per line", + "container.purgeCacheByURLCard.modal.buttonCancel": "Cancel", "container.railgunCard.title":"Railgun™", "container.railgunCard.description":"Accelerate delivery of dynamic content. Note: Requires software installation at your host.", "container.railgunCard.table.name":"Name", @@ -160,5 +200,14 @@ "container.zoneProvision.modal.title": "Delete Website", "container.zoneProvision.modal.description": "Are you sure you want to delete {zoneName}? To temporarily disable CloudFlare service and save your website settings, pause your website instead.", "container.zoneProvision.modal.buttonCancel": "Cancel", + "container.ipRewrite.title": "IP Rewrite", + "container.ipRewrite.description": "Rewrite CloudFlare IP Addresses for actual end-user IP Addresses at the application layer.", + "container.imageOptimization.title": "Image Optimization", + "container.imageOptimization.description": "Improve image load time and for pages that include images on mobile devices with slow network connections", + "container.waf.title": "Web Application Firewall", + "container.waf.description": "Set rules to protect your website from web vulnerabilities.", + "constants.plans.pro": "Pro plan", + "constants.plans.biz": "Business plan", + "constants.plans.ent": "Enterprise plan", "errors.noActiveZoneSelected": "Please select a domain that is provisioned with CloudFlare." } diff --git a/proxy.live.php b/proxy.live.php index 660661ac..1d61c4ff 100644 --- a/proxy.live.php +++ b/proxy.live.php @@ -1,6 +1,7 @@ getValue("debug")); +$config = new CF\Integration\DefaultConfig(file_get_contents('config.js')); +$logger = new CF\Integration\DefaultLogger($config->getValue('debug')); $cpanelAPI = new CF\Cpanel\CpanelAPI($cpanel, $logger); $dataStore = new CF\Cpanel\DataStore($cpanelAPI, $logger); -$cpanelIntegration = new CF\Cpanel\CpanelIntegration($config, $cpanelAPI, $dataStore, $logger); +$cpanelIntegration = new CF\Integration\DefaultIntegration($config, $cpanelAPI, $dataStore, $logger); $partialZoneSet = new \CF\Cpanel\Zone\Partial($cpanelAPI, $dataStore, $logger); -$clientAPIClient = new CF\API\Client($cpanelIntegration); -$clientAPIClientRoutes = \CF\Cpanel\ClientV4APIRoutes::$routes; -$hostAPIClient = new CF\API\Host($cpanelIntegration); -$hostAPIClientRoutes = \CF\Cpanel\HostRoutes::$routes; +$requestRouter = new \CF\Router\RequestRouter($cpanelIntegration); +$requestRouter->addRouter('\CF\API\Client', \CF\Cpanel\ClientV4APIRoutes::$routes); +$requestRouter->addRouter('\CF\API\Plugin', \CF\Cpanel\PluginRoutes::getRoutes(\CF\API\PluginRoutes::$routes)); +$requestRouter->addRouter('\CF\API\Host', \CF\Cpanel\HostRoutes::$routes); $method = $_SERVER['REQUEST_METHOD']; $parameters = $_GET; -$body = json_decode(file_get_contents('php://input'),true); -$path = (strtoupper($method === "GET") ? $_GET['proxyURL'] : $body['proxyURL']); +$body = json_decode(file_get_contents('php://input'), true); +$path = (strtoupper($method === 'GET') ? $_GET['proxyURL'] : $body['proxyURL']); unset($parameters['proxyURL']); unset($body['proxyURL']); $request = new \CF\API\Request($method, $path, $parameters, $body); -//only check CSRF if its not a GET request -$isCSRFTokenValid = (($request->getMethod() === "GET") ? true : \CF\SecurityUtil::csrfTokenValidate($cpanelAPI->getHostAPIKey(), $cpanelAPI->getUserId(), $request->getBody()['cfCSRFToken'])); +$isCSRFTokenValid = (($request->getMethod() === 'GET') ? true : \CF\SecurityUtil::csrfTokenValidate($cpanelAPI->getHostAPIKey(), $cpanelAPI->getUserId(), $request->getBody()['cfCSRFToken'])); unset($body['cfCSRFToken']); -$apiResponse = ""; -$apiRouter; -if(isHostAPI($request->getUrl())) { - $apiRouter = new CF\Router\HostAPIRouter($cpanelIntegration, $hostAPIClient, $hostAPIClientRoutes); -} else if(isClientAPI($request->getUrl())) { - $apiRouter = new CF\Router\DefaultRestAPIRouter($cpanelIntegration, $clientAPIClient, $clientAPIClientRoutes); -} -if($isCSRFTokenValid) { - $apiResponse = $apiRouter->route($request); +if ($isCSRFTokenValid) { + $response = $requestRouter->route($request); } else { - $apiResponse = $apiRouter->getAPIClient()->createAPIError("CSRF Token not valid."); + $message = 'CSRF Token not valid.'; + $response = array( + 'result' => null, + 'success' => false, + 'errors' => array( + array( + 'code' => '', + 'message' => $message, + ), + ), + 'messages' => array(), + ); } -echo json_encode($apiResponse); +echo json_encode($response); $cpanel->end(); - -/** - * @param $path - * @return bool - */ -function isClientAPI($path) { - return (strpos($path, \CF\API\Client::ENDPOINT) !== false); -} - -/** - * @param $path - * @return bool - */ -function isHostAPI($path) { - return ($path === \CF\API\Host::ENDPOINT); -} diff --git a/src/Cpanel/ClientActions.php b/src/Cpanel/ClientActions.php index d3213bb5..c62b9e7c 100644 --- a/src/Cpanel/ClientActions.php +++ b/src/Cpanel/ClientActions.php @@ -5,6 +5,7 @@ use CF\API\APIInterface; use CF\API\Request; use CF\Cpanel\Zone\Partial; +use CF\Integration\DefaultIntegration; class ClientActions { @@ -17,11 +18,11 @@ class ClientActions private $request; /** - * @param CpanelIntegration $cpanelIntegration - * @param APIInterface $api - * @param Request $request + * @param DefaultIntegration $cpanelIntegration + * @param APIInterface $api + * @param Request $request */ - public function __construct(CpanelIntegration $cpanelIntegration, APIInterface $api, Request $request) + public function __construct(DefaultIntegration $cpanelIntegration, APIInterface $api, Request $request) { $this->api = $api; $this->config = $cpanelIntegration->getConfig(); @@ -143,7 +144,7 @@ public function patchDNSRecord() */ public function deleteZone() { - if(!$this->cpanelAPI->isAdvancedZoneEditEnabled()) { + if (!$this->cpanelAPI->isAdvancedZoneEditEnabled()) { return $this->api->createAPIError(Partial::ADVANCED_ZONE_EDIT_DISABLED_ERROR); } diff --git a/src/Cpanel/CpanelAPI.php b/src/Cpanel/CpanelAPI.php index 9c48cfc0..90245a68 100644 --- a/src/Cpanel/CpanelAPI.php +++ b/src/Cpanel/CpanelAPI.php @@ -1,24 +1,24 @@ cpanel_api = $cpanel_api; $this->logger = $logger; @@ -31,15 +31,15 @@ public function __construct($cpanel_api, LoggerInterface $logger) */ private function api2($module, $function, $parameters) { - $this->logger->logAPICall(self::CPANEL_API2_NAME, array('type' => "request", 'module' => $module, 'function' => $function, 'parameters' => $parameters), true); + $this->logAPICall(self::CPANEL_API2_NAME, array('type' => 'request', 'module' => $module, 'function' => $function, 'parameters' => $parameters), true); $cpanel_api2_response = $this->cpanel_api->api2($module, $function, $parameters); - $this->logger->logAPICall(self::CPANEL_API2_NAME, array('type' => "response", $cpanel_api2_response), $this->api2ResponseOk($cpanel_api2_response)); + $this->logAPICall(self::CPANEL_API2_NAME, array('type' => 'response', $cpanel_api2_response), $this->api2ResponseOk($cpanel_api2_response)); if (!$this->api2ResponseOk($cpanel_api2_response)) { - $this->logger->logAPICall(self::CPANEL_API2_NAME, array('type' => "request", 'module' => $module, 'function' => $function, 'parameters' => $parameters), false); - $this->logger->logAPICall(self::CPANEL_API2_NAME, array('type' => "response", 'body' => $cpanel_api2_response), false); + $this->logAPICall(self::CPANEL_API2_NAME, array('type' => 'request', 'module' => $module, 'function' => $function, 'parameters' => $parameters), false); + $this->logAPICall(self::CPANEL_API2_NAME, array('type' => 'response', 'body' => $cpanel_api2_response), false); } return $cpanel_api2_response; @@ -47,16 +47,17 @@ private function api2($module, $function, $parameters) /** * @param $response + * * @return bool */ public function api2ResponseOk($response) { - return ($response["cpanelresult"]["error"] === null); + return $response['cpanelresult']['error'] === null; } - /** * @param $domain_name + * * @return array|null */ public function getDNSRecords($domain_name) @@ -65,29 +66,30 @@ public function getDNSRecords($domain_name) if ($this->api2ResponseOk($fetch_zone_records_result)) { $dnsRecordList = array(); - foreach ($fetch_zone_records_result["cpanelresult"]["data"] as $cpanelDNSRecord) { + foreach ($fetch_zone_records_result['cpanelresult']['data'] as $cpanelDNSRecord) { //if this is a record CloudFlare can proxy - if (!in_array($cpanelDNSRecord["type"], CpanelDNSRecord::$DNS_RECORDS_CF_CANNOT_PROXY)) { + if (!in_array($cpanelDNSRecord['type'], CpanelDNSRecord::$DNS_RECORDS_CF_CANNOT_PROXY)) { $cfDNSRecord = new CpanelDNSRecord(); - $content = ($cpanelDNSRecord["type"] === "CNAME") ? $cpanelDNSRecord["cname"] : $cpanelDNSRecord["address"]; + $content = ($cpanelDNSRecord['type'] === 'CNAME') ? $cpanelDNSRecord['cname'] : $cpanelDNSRecord['address']; $cfDNSRecord->setContent($content); - $cfDNSRecord->setName($cpanelDNSRecord["name"]); - $cfDNSRecord->setLine($cpanelDNSRecord["line"]); - $cfDNSRecord->setTtl($cpanelDNSRecord["ttl"]); - $cfDNSRecord->setType($cpanelDNSRecord["type"]); + $cfDNSRecord->setName($cpanelDNSRecord['name']); + $cfDNSRecord->setLine($cpanelDNSRecord['line']); + $cfDNSRecord->setTtl($cpanelDNSRecord['ttl']); + $cfDNSRecord->setType($cpanelDNSRecord['type']); array_push($dnsRecordList, $cfDNSRecord); } } + return $dnsRecordList; } - return null; + return; } - /** * @param $domain_name * @param DNSRecord $dnsRecord + * * @return bool */ public function addDNSRecord($domain_name, DNSRecord $dnsRecord) @@ -95,24 +97,26 @@ public function addDNSRecord($domain_name, DNSRecord $dnsRecord) $args = array( 'domain' => $domain_name, 'name' => $dnsRecord->getName(), - 'class' => "IN", + 'class' => 'IN', 'ttl' => $dnsRecord->getTtl(), 'type' => $dnsRecord->getType(), ); - if ($dnsRecord->getType() === "CNAME") { + if ($dnsRecord->getType() === 'CNAME') { $args['cname'] = $dnsRecord->getContent(); } else { //A, AAAA $args['address'] = $dnsRecord->getContent(); } $add_zone_record_response = $this->api2('ZoneEdit', 'add_zone_record', $args); + return $this->api2ResponseOk($add_zone_record_response); } /** * @param $domain_name * @param DNSRecord $dnsRecord + * * @return bool */ public function editDNSRecord($domain_name, DNSRecord $dnsRecord) @@ -127,7 +131,7 @@ public function editDNSRecord($domain_name, DNSRecord $dnsRecord) 'class' => 'IN', ); - if ($dnsRecord->getType() === "CNAME") { + if ($dnsRecord->getType() === 'CNAME') { $args['cname'] = $dnsRecord->getContent(); } else { //A, AAAA $args['address'] = $dnsRecord->getContent(); @@ -146,6 +150,7 @@ public function removeDNSRecord($domain_name, DNSRecord $DNSRecord) ); $remove_zone_record_response = $this->api2('ZoneEdit', 'remove_zone_record', $args); + return $this->api2ResponseOk($remove_zone_record_response); } @@ -154,45 +159,51 @@ public function removeDNSRecord($domain_name, DNSRecord $DNSRecord) * @param $function * @param $parameters * @param $value + * * @return mixed + * * @throws \Exception */ private function uapi($module, $function, $parameters, $value) { - $this->logger->logAPICall(self::CPANEL_UAPI_NAME, array('type' => "request", 'module' => $module, 'function' => $function, 'parameters' => $parameters), true); + $this->logAPICall(self::CPANEL_UAPI_NAME, array('type' => 'request', 'module' => $module, 'function' => $function, 'parameters' => $parameters), true); $cpanel_uapi_response = $this->cpanel_api->uapi($module, $function, $parameters, $value); - $this->logger->logAPICall(self::CPANEL_UAPI_NAME, array('type' => "response", 'body' => $this->sanitize_uapi_response_for_log($cpanel_uapi_response)), $this->uapi_response_ok($cpanel_uapi_response)); + $this->logAPICall(self::CPANEL_UAPI_NAME, array('type' => 'response', 'body' => $this->sanitize_uapi_response_for_log($cpanel_uapi_response)), $this->uapi_response_ok($cpanel_uapi_response)); if ($this->uapi_response_ok($cpanel_uapi_response)) { - return $cpanel_uapi_response["cpanelresult"]["result"]["data"]; + return $cpanel_uapi_response['cpanelresult']['result']['data']; } else { - $this->logger->logAPICall(self::CPANEL_UAPI_NAME, array('type' => "request", 'module' => $module, 'function' => $function, 'parameters' => $parameters), false); - $this->logger->logAPICall(self::CPANEL_UAPI_NAME, array('type' => "response", 'body' => $this->sanitize_uapi_response_for_log($cpanel_uapi_response)), false); + $this->logAPICall(self::CPANEL_UAPI_NAME, array('type' => 'request', 'module' => $module, 'function' => $function, 'parameters' => $parameters), false); + $this->logAPICall(self::CPANEL_UAPI_NAME, array('type' => 'response', 'body' => $this->sanitize_uapi_response_for_log($cpanel_uapi_response)), false); + return $cpanel_uapi_response; } } /** * @param $cpanel_uapi_response + * * @return bool */ public function uapi_response_ok($cpanel_uapi_response) { - return ($cpanel_uapi_response["cpanelresult"]["result"]["errors"] === null); + return $cpanel_uapi_response['cpanelresult']['result']['errors'] === null; } /** * @param $cpanel_uapi_response + * * @return mixed */ private function sanitize_uapi_response_for_log($cpanel_uapi_response) { if ($this->uapi_response_ok($cpanel_uapi_response)) { - if ($cpanel_uapi_response["cpanelresult"]["func"] === "get_host_api_key") { - $cpanel_uapi_response["cpanelresult"]["result"]["data"] = "[HIDDEN]"; + if ($cpanel_uapi_response['cpanelresult']['func'] === 'get_host_api_key') { + $cpanel_uapi_response['cpanelresult']['result']['data'] = '[HIDDEN]'; } } + return $cpanel_uapi_response; } @@ -207,6 +218,7 @@ public function get_home_dir() /** * @return host api key + * * @throws \Exception */ public function getHostAPIKey() @@ -223,9 +235,9 @@ public function getUserId() return $this->cpanel_api->cpanelprint('$user'); } - /** * @param $userId + * * @return mixed */ public function getDomainList($userId = null) @@ -241,7 +253,9 @@ public function getDomainList($userId = null) /** * @param $folder * @param $filename + * * @return mixed + * * @throws \Exception */ public function load_file($folder, $filename) @@ -250,10 +264,10 @@ public function load_file($folder, $filename) 'Fileman', 'get_file_content', array( - 'dir' => $folder, - 'file' => $filename, - 'from_charset' => '_DETECT_', - 'to_charset' => '_LOCALE_', + 'dir' => $folder, + 'file' => $filename, + 'from_charset' => '_DETECT_', + 'to_charset' => '_LOCALE_', ), null ); @@ -263,6 +277,7 @@ public function load_file($folder, $filename) * @param $folder * @param $filename * @param $file_contents + * * @throws \Exception */ public function save_file($folder, $filename, $file_contents) @@ -271,11 +286,11 @@ public function save_file($folder, $filename, $file_contents) 'Fileman', 'save_file_content', array( - 'dir' => $folder, - 'file' => $filename, - 'from_charset' => 'UTF-8', - 'to_charset' => 'UTF-8', - 'content' => $file_contents, + 'dir' => $folder, + 'file' => $filename, + 'from_charset' => 'UTF-8', + 'to_charset' => 'UTF-8', + 'content' => $file_contents, ), null ); @@ -284,17 +299,30 @@ public function save_file($folder, $filename, $file_contents) public function get_cpanel_dns_record_name($cloudflare_dns_record_name) { //cpanel uses the trailing dot for all record names - return $cloudflare_dns_record_name . "."; + return $cloudflare_dns_record_name.'.'; } /** * @return bool */ - public function isAdvancedZoneEditEnabled() { + public function isAdvancedZoneEditEnabled() + { /* Advanced Zone Editor is required to edit DNS records for partial zone provisioning. * https://documentation.cpanel.net/display/SDK/Guide+to+the+LiveAPI+System+-+The+cpanelfeature%28%29+Method * cPanel returns 1 = enabled, 0 = disabled */ - return ($this->cpanel_api->cpanelfeature("zoneedit") === 1); + return $this->cpanel_api->cpanelfeature('zoneedit') === 1; + } + + public function logAPICall($api, $message, $is_debug) + { + $log_level = 'error'; + if ($is_debug) { + $log_level = 'debug'; + } + if (!is_string($message)) { + $message = print_r($message, true); + } + $this->logger->$log_level('['.$api.'] '.$message); } } diff --git a/src/Cpanel/CpanelIntegration.php b/src/Cpanel/CpanelIntegration.php index d114b3b4..ae55643e 100644 --- a/src/Cpanel/CpanelIntegration.php +++ b/src/Cpanel/CpanelIntegration.php @@ -6,7 +6,7 @@ use CF\Integration\DataStoreInterface; use CF\Integration\IntegrationAPIInterface; use CF\Integration\IntegrationInterface; -use CF\Integration\LoggerInterface; +use Psr\Log\LoggerInterface; class CpanelIntegration implements IntegrationInterface { @@ -16,10 +16,10 @@ class CpanelIntegration implements IntegrationInterface private $logger; /** - * @param ConfigInterface $config - * @param CpanelAPI $cpanelAPI - * @param DataStoreInterface $dataStore - * @param LoggerInterface $logger + * @param ConfigInterface $config + * @param CpanelAPI $cpanelAPI + * @param DataStoreInterface $dataStore + * @param Psr\Log\LoggerInterface $logger */ public function __construct(ConfigInterface $config, CpanelAPI $cpanelAPI, DataStoreInterface $dataStore, LoggerInterface $logger) { diff --git a/src/Cpanel/DataStore.php b/src/Cpanel/DataStore.php index 10c1212d..aadafac4 100644 --- a/src/Cpanel/DataStore.php +++ b/src/Cpanel/DataStore.php @@ -1,7 +1,8 @@ cpanel = $cpanel; $this->logger = $logger; @@ -42,12 +42,15 @@ public function __construct(CpanelAPI $cpanel, LoggerInterface $logger) * createUserDataStore(). Eventually we need to remove the function below and its use in index.live.php. */ /** - * @return bool + * @return mixed */ - public function getDeprecatedHostUserUniqueID() { - if(isset($this->yaml_data[self::DEPRECATED_HOST_USER_UNIQUE_ID_KEY])) { - return $this->yaml_data[self::DEPRECATED_HOST_USER_UNIQUE_ID_KEY][$this->username]; + public function getDeprecatedHostUserUniqueID() + { + $deprectatedHostKey = $this->get(self::DEPRECATED_HOST_USER_UNIQUE_ID_KEY); + if (isset($deprectatedHostKey)) { + return $deprectatedHostKey[$this->username]; } + return false; } @@ -56,12 +59,13 @@ public function getDeprecatedHostUserUniqueID() { */ private function loadYAMLFile() { - $get_file_content = $this->cpanel->load_file($this->home_dir . self::PATH_TO_YAML_FILE, self::YAML_FILE_NAME); + $get_file_content = $this->cpanel->load_file($this->home_dir.self::PATH_TO_YAML_FILE, self::YAML_FILE_NAME); if ($this->cpanel->uapi_response_ok($get_file_content)) { - return Yaml::parse($get_file_content["content"]); + return Yaml::parse($get_file_content['content']); } else { - $this->logger->error(self::PATH_TO_YAML_FILE . self::YAML_FILE_NAME . " does not exist."); + $this->logger->error(self::PATH_TO_YAML_FILE.self::YAML_FILE_NAME.' does not exist.'); } + return false; } @@ -71,17 +75,16 @@ private function loadYAMLFile() private function saveYAMLFile() { $file_contents = Yaml::dump($this->yaml_data); - $result = $this->cpanel->save_file($this->home_dir . self::PATH_TO_YAML_FILE, self::YAML_FILE_NAME, $file_contents); + $result = $this->cpanel->save_file($this->home_dir.self::PATH_TO_YAML_FILE, self::YAML_FILE_NAME, $file_contents); + return $this->cpanel->uapi_response_ok($result); } - /** * @param $client_api_key * @param $email * @param $unique_id * @param $user_key - * @return bool */ public function createUserDataStore($client_api_key, $email, $unique_id, $user_key) { @@ -89,9 +92,10 @@ public function createUserDataStore($client_api_key, $email, $unique_id, $user_k self::CLIENT_API_KEY => $client_api_key, self::EMAIL_KEY => $email, self::HOST_USER_UNIQUE_ID_KEY => $unique_id, - self::HOST_USER_KEY => $user_key + self::HOST_USER_KEY => $user_key, ); - return $this->saveYAMLFile(); + + $this->saveYAMLFile(); } /** @@ -99,7 +103,7 @@ public function createUserDataStore($client_api_key, $email, $unique_id, $user_k */ public function getHostAPIUserUniqueId() { - return $this->yaml_data[self::HOST_USER_UNIQUE_ID_KEY]; + return $this->get(self::HOST_USER_UNIQUE_ID_KEY); } /** @@ -107,7 +111,7 @@ public function getHostAPIUserUniqueId() */ public function getClientV4APIKey() { - return $this->yaml_data[self::CLIENT_API_KEY]; + return $this->get(self::CLIENT_API_KEY); } /** @@ -115,7 +119,7 @@ public function getClientV4APIKey() */ public function getHostAPIUserKey() { - return $this->yaml_data[self::HOST_USER_KEY]; + return $this->get(self::HOST_USER_KEY); } /** @@ -123,6 +127,33 @@ public function getHostAPIUserKey() */ public function getCloudFlareEmail() { - return $this->yaml_data[self::EMAIL_KEY]; + return $this->get(self::EMAIL_KEY); + } + + /** + * @param $key + * + * @return mixed + */ + public function get($key) + { + return $this->yaml_data[$key]; + } + + /** + * @param $key + * @param $value + * + * @return mixed + */ + public function set($key, $value) + { + if (isEmpty($this->yaml_data)) { + $this->yaml_data = array(); + } + + $this->yaml_data[$key] = $value; + + return $this->saveYAMLFile(); } } diff --git a/src/Cpanel/HostActions.php b/src/Cpanel/HostActions.php index 68ac59ed..8f978a27 100644 --- a/src/Cpanel/HostActions.php +++ b/src/Cpanel/HostActions.php @@ -2,10 +2,11 @@ namespace CF\Cpanel; -use \CF\API\APIInterface; +use CF\API\APIInterface; use CF\API\Request; -use \CF\Cpanel\Zone\Partial; -use \CF\SecurityUtil; +use CF\Cpanel\Zone\Partial; +use CF\SecurityUtil; +use CF\Integration\DefaultIntegration; class HostActions { @@ -18,11 +19,11 @@ class HostActions private $request; /** - * @param CpanelIntegration $cpanelIntegration - * @param APIInterface $api - * @param Request $request + * @param DefaultIntegration $cpanelIntegration + * @param APIInterface $api + * @param Request $request */ - public function __construct(CpanelIntegration $cpanelIntegration, APIInterface $api, Request $request) + public function __construct(DefaultIntegration $cpanelIntegration, APIInterface $api, Request $request) { $this->api = $api; $this->config = $cpanelIntegration->getConfig(); @@ -36,29 +37,32 @@ public function __construct(CpanelIntegration $cpanelIntegration, APIInterface $ /** * @param Partial $partialZoneSet */ - public function setPartialZoneSet(Partial $partialZoneSet) { + public function setPartialZoneSet(Partial $partialZoneSet) + { $this->partialZoneSet = $partialZoneSet; } /** - * ?act=zone_set + * ?act=zone_set. + * * @return string */ public function partialZoneSet() { - if(!$this->cpanelAPI->isAdvancedZoneEditEnabled()) { + if (!$this->cpanelAPI->isAdvancedZoneEditEnabled()) { return $this->api->createAPIError(Partial::ADVANCED_ZONE_EDIT_DISABLED_ERROR); } $bodyParameters = $this->request->getBody(); - if (isset($bodyParameters["zone_name"])) { - if ($this->partialZoneSet->partialZoneSet("www." . $bodyParameters["zone_name"] . ".", $bodyParameters["zone_name"])) { - $bodyParameters["subdomains"] = "www"; + if (isset($bodyParameters['zone_name'])) { + if ($this->partialZoneSet->partialZoneSet('www.'.$bodyParameters['zone_name'].'.', $bodyParameters['zone_name'])) { + $bodyParameters['subdomains'] = 'www'; //remove trailing . get_resolve_to_value() adds to the end cause Host API doesn't want it. - $bodyParameters["resolve_to"] = rtrim($this->partialZoneSet->getResolveToValue($bodyParameters["zone_name"]), "."); + $bodyParameters['resolve_to'] = rtrim($this->partialZoneSet->getResolveToValue($bodyParameters['zone_name']), '.'); $this->request->setBody($bodyParameters); + return $this->api->callAPI($this->request); } else { - return $this->api->createAPIError("Cpanel was unable to provision '" . $bodyParameters["zone_name"] . "' please contact your hosting provider."); + return $this->api->createAPIError("Cpanel was unable to provision '".$bodyParameters['zone_name']."' please contact your hosting provider."); } } else { return $this->api->createAPIError("Missing parameter 'zone_name'."); @@ -66,7 +70,8 @@ public function partialZoneSet() } /** - * ?act=user_create + * ?act=user_create. + * * @return string */ public function userCreate() @@ -74,18 +79,18 @@ public function userCreate() $unique_id = SecurityUtil::generate16bytesOfSecureRandomData(); //if generate16BytesOfSecureRandomData fails fall back to md5 if ($unique_id === false) { - $this->logger->warn("SecurityUtil::generate16bytesOfSecureRandomData failed."); - $unique_id = md5($this->request->getBody()["cloudflare_email"] . time() . $this->cpanelAPI->getUserId() . $this->cpanelAPI->get_home_dir() . $this->cpanelAPI->getHostAPIKey()); + $this->logger->warn('SecurityUtil::generate16bytesOfSecureRandomData failed.'); + $unique_id = md5($this->request->getBody()['cloudflare_email'].time().$this->cpanelAPI->getUserId().$this->cpanelAPI->get_home_dir().$this->cpanelAPI->getHostAPIKey()); } - $parameters['body']["unique_id"] = $unique_id; + $parameters['body']['unique_id'] = $unique_id; $user_create_response = $this->api->callAPI($this->request); if ($this->api->responseOk($user_create_response)) { - $user_api_key = $user_create_response["response"]["user_api_key"]; - $cloudflare_email = $user_create_response["response"]["cloudflare_email"]; - $unique_id = $user_create_response["response"]["unique_id"]; - $user_key = $user_create_response["response"]["user_key"]; + $user_api_key = $user_create_response['response']['user_api_key']; + $cloudflare_email = $user_create_response['response']['cloudflare_email']; + $unique_id = $user_create_response['response']['unique_id']; + $user_key = $user_create_response['response']['user_key']; $this->dataStore->createUserDataStore($user_api_key, $cloudflare_email, $unique_id, $user_key); } @@ -94,7 +99,8 @@ public function userCreate() } /** - * ?act=user_auth + * ?act=user_auth. + * * @return string */ public function userAuth() @@ -102,10 +108,10 @@ public function userAuth() $user_auth_response = $this->api->callAPI($this->request); if ($this->api->responseOk($user_auth_response)) { - $user_api_key = $user_auth_response["response"]["user_api_key"]; - $cloudflare_email = $user_auth_response["response"]["cloudflare_email"]; - $unique_id = $user_auth_response["response"]["unique_id"]; - $user_key = $user_auth_response["response"]["user_key"]; + $user_api_key = $user_auth_response['response']['user_api_key']; + $cloudflare_email = $user_auth_response['response']['cloudflare_email']; + $unique_id = $user_auth_response['response']['unique_id']; + $user_key = $user_auth_response['response']['user_key']; $this->dataStore->createUserDataStore($user_api_key, $cloudflare_email, $unique_id, $user_key); } diff --git a/src/Cpanel/PluginActions.php b/src/Cpanel/PluginActions.php new file mode 100644 index 00000000..20ab3dc7 --- /dev/null +++ b/src/Cpanel/PluginActions.php @@ -0,0 +1,24 @@ + $route) { + $route['class'] = 'CF\Cpanel\PluginActions'; + $routeList[$routePath] = $route; + } + + return $routeList; + } +} diff --git a/src/Cpanel/Zone/Partial.php b/src/Cpanel/Zone/Partial.php index f9c9b152..d3bdafb9 100644 --- a/src/Cpanel/Zone/Partial.php +++ b/src/Cpanel/Zone/Partial.php @@ -1,10 +1,11 @@ logger = $logger; } - /** * @param $sub_domain * @param $domain_name + * * @return bool */ public function partialZoneSet($sub_domain, $domain_name) @@ -49,16 +50,18 @@ public function partialZoneSet($sub_domain, $domain_name) return false; } - if (strtoupper($sub_domain_dns_record->getType()) === "CNAME") { + if (strtoupper($sub_domain_dns_record->getType()) === 'CNAME') { return $this->provisionSubDomainCNAMERecord($sub_domain_dns_record); - } else if (strtoupper($sub_domain_dns_record->getType()) === "A") { + } elseif (strtoupper($sub_domain_dns_record->getType()) === 'A') { return $this->provisionSubDomainARecord($sub_domain_dns_record); } + return false; } /** * @param $domainName + * * @return bool */ public function removePartialZoneSet($domainName) @@ -81,7 +84,7 @@ public function removePartialZoneSet($domainName) } foreach ($this->dns_record_list as $dnsRecord) { - if ($dnsRecord->getType() === "CNAME") { + if ($dnsRecord->getType() === 'CNAME') { //if this domain is pointing at cloudflare revert it. if ($dnsRecord->getContent() === $this->getForwardToValue($dnsRecord->getName())) { $dnsRecord->setContent($this->domain_name); @@ -91,6 +94,7 @@ public function removePartialZoneSet($domainName) } } } + return true; } @@ -108,14 +112,13 @@ private function getSubDomainDNSRecord($sub_domain) } } - $this->logger->error("Could not find '". $sub_domain ."' in the '" . $this->domain_name . "'. dns records."); - return null; - } + $this->logger->error("Could not find '".$sub_domain."' in the '".$this->domain_name."'. dns records."); + return; + } /** * @param $dnsRecordList - * @return null */ public function getResolveToDNSRecord($dnsRecordList) { @@ -126,13 +129,14 @@ public function getResolveToDNSRecord($dnsRecordList) } } } - $this->logger->error("Could not find the '" . self::RESOLVE_TO_PREFIX . "' record for '" . $this->domain_name . "'."); - return null; - } + $this->logger->error("Could not find the '".self::RESOLVE_TO_PREFIX."' record for '".$this->domain_name."'."); + return; + } /** * @param $subDomainCNAMEDNSRecord + * * @return bool */ private function provisionSubDomainCNAMERecord($subDomainCNAMEDNSRecord) @@ -145,29 +149,33 @@ private function provisionSubDomainCNAMERecord($subDomainCNAMEDNSRecord) //create CNAME cloudflare-resolve-to.[DOMAIN]. => [DOMAIN] if it doesn't exist. return $this->createCNAMERecord($this->getResolveToValue($this->domain_name), $this->domain_name); } + return true; } + return false; } /** * @param $name * @param $cnameValue + * * @return bool */ private function createCNAMERecord($name, $cnameValue) { $dnsRecord = new CpanelDNSRecord(); - $dnsRecord->setType("CNAME"); + $dnsRecord->setType('CNAME'); $dnsRecord->setContent($cnameValue); $dnsRecord->setName($name); $dnsRecord->setTtl(1400); + return $this->cpanel_api->addDNSRecord($this->domain_name, $dnsRecord); } - /** * @param $subDomainDNSRecord + * * @return bool */ private function provisionSubDomainARecord($subDomainDNSRecord) @@ -181,6 +189,7 @@ private function provisionSubDomainARecord($subDomainDNSRecord) if ($this->getResolveToDNSRecord($this->dns_record_list) === null) { return $this->createARecord($this->getResolveToValue($this->domain_name), $subDomainARecordIP); } + return true; } } @@ -191,20 +200,23 @@ private function provisionSubDomainARecord($subDomainDNSRecord) /** * @param $name * @param $address + * * @return bool */ private function createARecord($name, $address) { $dnsRecord = new CpanelDNSRecord(); - $dnsRecord->setType("A"); + $dnsRecord->setType('A'); $dnsRecord->setContent($address); $dnsRecord->setName($name); $dnsRecord->setTtl(1400); + return $this->cpanel_api->addDNSRecord($this->domain_name, $dnsRecord); } /** * @param $line + * * @return bool */ private function removeDNSRecord($line) @@ -215,26 +227,30 @@ private function removeDNSRecord($line) if ($this->cpanel_api->removeDNSRecord($this->domain_name, $dnsRecord)) { //after we remove a dns record refresh the list since the line numbers have changed. $this->dns_record_list = $this->cpanel_api->getDNSRecords($this->domain_name); + return true; } + return false; } /** * @param $subDomain + * * @return string */ public function getForwardToValue($subDomain) { - return $subDomain . self::FORWARD_TO_SUFFIX; + return $subDomain.self::FORWARD_TO_SUFFIX; } /** * @param $domainName + * * @return string */ public function getResolveToValue($domainName) { - return self::RESOLVE_TO_PREFIX . $domainName . "."; + return self::RESOLVE_TO_PREFIX.$domainName.'.'; } } diff --git a/sync.sh b/sync.sh index 15d83816..26380397 100755 --- a/sync.sh +++ b/sync.sh @@ -3,6 +3,7 @@ #$1 = username #$2 = hostname USRHOSTFLDR="$1@$2:/usr/local" +PHPVERSION="56" rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./proxy.live.php $USRHOSTFLDR/cpanel/base/frontend/paper_lantern/cloudflare/proxy.live.php rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./index.live.php $USRHOSTFLDR/cpanel/base/frontend/paper_lantern/cloudflare/index.live.php @@ -15,5 +16,5 @@ rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHos rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./lang/ $USRHOSTFLDR/cpanel/base/frontend/paper_lantern/cloudflare/lang rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./CloudFlare.pm $USRHOSTFLDR/cpanel/Cpanel/API/CloudFlare.pm rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./APIKey $USRHOSTFLDR/cpanel/bin/admin/CloudFlare/APIKey -rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./vendor/ $USRHOSTFLDR/cpanel/3rdparty/php/54/lib/php/cloudflare/vendor -rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./src/ $USRHOSTFLDR/cpanel/3rdparty/php/54/lib/php/cloudflare/src +rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./vendor/ $USRHOSTFLDR/cpanel/3rdparty/php/$PHPVERSION/lib/php/cloudflare/vendor +rsync -avz --no-owner --no-group --no-perms --copy-dirlinks -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress ./src/ $USRHOSTFLDR/cpanel/3rdparty/php/$PHPVERSION/lib/php/cloudflare/src diff --git a/vendor/cloudflare/cloudflare-plugin-backend/CHANGELOG.md b/vendor/cloudflare/cloudflare-plugin-backend/CHANGELOG.md index 35013bb6..c87ea0f1 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/CHANGELOG.md +++ b/vendor/cloudflare/cloudflare-plugin-backend/CHANGELOG.md @@ -2,6 +2,48 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [1.1.0](#1.1.0) - 2016-08-11 +### Added +- Added CF\Router\RequestRouter to consolidate duplicate request routing logic each plugin was implementing. [#8](https://github.com/cloudflare/cloudflare-plugin-backend/pull/8) +### Changed +- PluginRoutes, PluginActions moved to CF\API to consolidate the Internal Plugin API logic across all plugins. [#10](https://github.com/cloudflare/cloudflare-plugin-backend/pull/10) + +## [1.0.9](#1.0.9) - 2016-08-03 +### Changed +- Removed static type checking to support earlier php versions [ad13c1e](https://github.com/cloudflare/cloudflare-plugin-backend/commit/ad13c1ec6edeceae5a85f8912208ce2c80f4a5f2) + +## [1.0.8](#1.0.8) - 2016-08-02 +### Changed +- Fixed error message bug [61584ca](https://github.com/cloudflare/cloudflare-plugin-backend/commit/61584ca56f8ed6ba76cb321593955e0b57f3c88d) + +## [1.0.7](#1.0.7) - 2016-08-02 +### Changed +- Updated CHANGELOG [5e72177](https://github.com/cloudflare/cloudflare-plugin-backend/commit/5e72177aadf1c34cf75904b52bf017e7b6c6c672) + +## [1.0.6](#1.0.6) - 2016-08-02 +### Changed +- Changed error message from always "Bad Request" to original API message [235b020](https://github.com/cloudflare/cloudflare-plugin-backend/commit/235b020ad48cf9c0d2cdcb067b34d1424f0571f6) + +## [1.0.5](#1.0.5) - 2016-07-22 +### Added +- PI-697 added PLUGIN_SPECIFIC_CACHE consts to CF\API\Plugin [10fb134](https://github.com/cloudflare/cloudflare-plugin-backend/commit/10fb1346d81e6b7fb71abfdfb93ce12c3d55fb91) + +## [1.0.4](#1.0.4) - 2016-07-15 +### Added +- Added setting name consts to CF\API\Plugin [70372ab](https://github.com/cloudflare/cloudflare-plugin-backend/commit/70372ab0d1e294e0e6b57799e31c8a22ed4dedf6) + + +## [1.0.3](#1.0.3) - 2016-06-27 +### Added +- Added CF\API\Plugin.php built by @thellimist to handle plugin specific API calls. [#3](https://github.com/cloudflare/cloudflare-plugin-backend/pull/3) + +## [1.0.2](#1.0.2) - 2016-06-14 +### Changed +- CF\Integration\LoggerInterface::logAPICall() moved to CF\API\AbstractAPIClient::logAPICall(). [#2](https://github.com/cloudflare/cloudflare-plugin-backend/pull/2) + +## Removed +- Removed CF\Integration\LoggerInterface. [#2](https://github.com/cloudflare/cloudflare-plugin-backend/pull/2) + ## [1.0.1](#1.0.1) - 2016-06-07 ### Changed -- CF\Integration\LoggerInterface now implements PSR-3 LoggerInterface [#1](https://github.com/cloudflare/cloudflare-plugin-backend/pull/1) +- CF\Integration\LoggerInterface now implements PSR-3 LoggerInterface. [#1](https://github.com/cloudflare/cloudflare-plugin-backend/pull/1) diff --git a/vendor/cloudflare/cloudflare-plugin-backend/composer.json b/vendor/cloudflare/cloudflare-plugin-backend/composer.json index 850bba8e..8d45acdc 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/composer.json +++ b/vendor/cloudflare/cloudflare-plugin-backend/composer.json @@ -2,7 +2,7 @@ "name": "cloudflare/cloudflare-plugin-backend", "description": "A PHP backend for CloudFlare plugins.", "license": "BSD-3-Clause", - "version": "1.0.1", + "version": "1.1.0", "scripts": { "test": "vendor/bin/phpunit", "format": "vendor/bin/phpcs -n --standard=PSR2 --extensions=php,live.php src/" diff --git a/vendor/cloudflare/cloudflare-plugin-backend/composer.lock b/vendor/cloudflare/cloudflare-plugin-backend/composer.lock index db77ac65..545a39fe 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/composer.lock +++ b/vendor/cloudflare/cloudflare-plugin-backend/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "df982ae9219156f01be914fdc1bba16f", - "content-hash": "9931ed117dddd3668b80df1c29de7734", + "hash": "f887449dc6157ac9f04c5b7fcf003229", + "content-hash": "00292135fbc8ae1a789cc19840367a35", "packages": [ { "name": "guzzlehttp/guzzle", - "version": "5.3.0", + "version": "5.3.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "f3c8c22471cb55475105c14769644a49c3262b93" + "reference": "70f1fa53b71c4647bf2762c09068a95f77e12fb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93", - "reference": "f3c8c22471cb55475105c14769644a49c3262b93", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/70f1fa53b71c4647bf2762c09068a95f77e12fb8", + "reference": "70f1fa53b71c4647bf2762c09068a95f77e12fb8", "shasum": "" }, "require": { @@ -27,15 +27,9 @@ }, "require-dev": { "ext-curl": "*", - "phpunit/phpunit": "^4.0", - "psr/log": "^1.0" + "phpunit/phpunit": "^4.0" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, "autoload": { "psr-4": { "GuzzleHttp\\": "src/" @@ -63,7 +57,7 @@ "rest", "web service" ], - "time": "2015-05-20 03:47:55" + "time": "2016-07-15 19:28:39" }, { "name": "guzzlehttp/ringphp", @@ -304,39 +298,136 @@ ], "time": "2015-06-14 21:17:01" }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-12-27 11:43:31" + }, { "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2016-06-10 09:48:41" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "phpDocumentor": [ + "psr-4": { + "phpDocumentor\\Reflection\\": [ "src/" ] } @@ -348,39 +439,39 @@ "authors": [ { "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" + "email": "me@mikevanriel.com" } ], - "time": "2015-02-03 12:10:50" + "time": "2016-06-10 07:14:17" }, { "name": "phpspec/prophecy", - "version": "v1.6.0", + "version": "v1.6.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } }, "autoload": { @@ -413,7 +504,7 @@ "spy", "stub" ], - "time": "2016-02-15 07:46:21" + "time": "2016-06-07 08:13:47" }, { "name": "phpunit/php-code-coverage", @@ -660,16 +751,16 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.26", + "version": "4.8.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74" + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74", - "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90", + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90", "shasum": "" }, "require": { @@ -728,7 +819,7 @@ "testing", "xunit" ], - "time": "2016-05-17 03:09:28" + "time": "2016-07-21 06:48:14" }, { "name": "phpunit/phpunit-mock-objects", @@ -954,16 +1045,16 @@ }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -971,12 +1062,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -1016,7 +1108,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -1159,16 +1251,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "2.6.1", + "version": "2.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d" + "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/fb72ed32f8418db5e7770be1653e62e0d6f5dd3d", - "reference": "fb72ed32f8418db5e7770be1653e62e0d6f5dd3d", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4edb770cb853def6e60c93abb088ad5ac2010c83", + "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83", "shasum": "" }, "require": { @@ -1233,29 +1325,29 @@ "phpcs", "standards" ], - "time": "2016-05-30 22:24:32" + "time": "2016-07-13 23:29:13" }, { "name": "symfony/yaml", - "version": "v2.8.6", + "version": "v3.1.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940" + "reference": "1819adf2066880c7967df7180f4f662b6f0567ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e4fbcc65f90909c999ac3b4dfa699ee6563a9940", - "reference": "e4fbcc65f90909c999ac3b4dfa699ee6563a9940", + "url": "https://api.github.com/repos/symfony/yaml/zipball/1819adf2066880c7967df7180f4f662b6f0567ac", + "reference": "1819adf2066880c7967df7180f4f662b6f0567ac", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "3.1-dev" } }, "autoload": { @@ -1282,7 +1374,57 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2016-03-29 19:00:15" + "time": "2016-07-17 14:02:08" + }, + { + "name": "webmozart/assert", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2016-08-09 15:02:57" } ], "aliases": [], diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/API/AbstractAPIClient.php b/vendor/cloudflare/cloudflare-plugin-backend/src/API/AbstractAPIClient.php index 0202106d..2999fc83 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/API/AbstractAPIClient.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/API/AbstractAPIClient.php @@ -8,9 +8,8 @@ abstract class AbstractAPIClient implements APIInterface { - - const CONTENT_TYPE_KEY = "Content-Type"; - const APPLICATION_JSON_KEY = "application/json"; + const CONTENT_TYPE_KEY = 'Content-Type'; + const APPLICATION_JSON_KEY = 'application/json'; protected $config; protected $data_store; @@ -30,6 +29,7 @@ public function __construct(IntegrationInterface $integration) /** * @param Request $request + * * @return array|mixed */ public function callAPI(Request $request) @@ -39,15 +39,15 @@ public function callAPI(Request $request) $request = $this->beforeSend($request); - $bodyType = (($request->getHeaders()[self::CONTENT_TYPE_KEY] === self::APPLICATION_JSON_KEY) ? "json" : "body"); + $bodyType = (($request->getHeaders()[self::CONTENT_TYPE_KEY] === self::APPLICATION_JSON_KEY) ? 'json' : 'body'); $requestOptions = array( 'headers' => $request->getHeaders(), 'query' => $request->getParameters(), - $bodyType => $request->getBody() + $bodyType => $request->getBody(), ); - if ($this->config->getValue("debug")) { + if ($this->config->getValue('debug')) { $requestOptions['debug'] = fopen('php://stderr', 'w'); } @@ -56,30 +56,76 @@ public function callAPI(Request $request) $response = $client->send($apiRequest)->json(); if (json_last_error() !== JSON_ERROR_NONE) { - throw new RequestException("Error decoding client API JSON", $response); + throw new RequestException('Error decoding client API JSON', $response); } if (!$this->responseOk($response)) { - $this->logger->logAPICall($this->getAPIClientName(), array('type' => 'response', 'body' => $response), false); + $this->logAPICall($this->getAPIClientName(), array('type' => 'response', 'body' => $response), true); } return $response; } catch (RequestException $e) { - $this->logger->logAPICall($this->getAPIClientName(), array( - 'type' => "request", + $errorMessage = $this->getErrorMessage($e); + + $this->logAPICall($this->getAPIClientName(), array( + 'type' => 'request', 'method' => $request->getMethod(), 'path' => $request->getUrl(), 'headers' => $request->getHeaders(), 'params' => $request->getParameters(), - 'body' => $request->getBody()), false); - $this->logger->logAPICall($this->getAPIClientName(), array('type' => "response", 'code' => $e->getCode(), 'body' => $e->getMessage(), 'stacktrace' => $e->getTraceAsString()), false); - return $this->createAPIError($e->getMessage()); + 'body' => $request->getBody(), ), true); + $this->logAPICall($this->getAPIClientName(), array('type' => 'response', 'code' => $e->getCode(), 'body' => $errorMessage, 'stacktrace' => $e->getTraceAsString()), true); + + return $this->createAPIError($errorMessage); } } + /** + * @param RequestException $object + * + * @return string + */ + public function getErrorMessage(RequestException $error) + { + return $error->getMessage(); + } + + /** + * @param string $apiName + * @param array $message + * @param bool $isError + */ + public function logAPICall($apiName, $message, $isError) + { + $logLevel = 'error'; + if ($isError === false) { + $logLevel = 'debug'; + } + + if (!is_string($message)) { + $message = print_r($message, true); + } + + $this->logger->$logLevel('['.$apiName.'] '.$message); + } /** * @param Request $request + * @return string + */ + public function getPath(Request $request) + { + //substring of everything after the endpoint is the path + return substr($request->getUrl(), strpos($request->getUrl(), $this->getEndpoint()) + strlen($this->getEndpoint())); + } + + function shouldRouteRequest(Request $request) { + return (strpos($request->getUrl(), $this->getEndpoint()) !== false); + } + + /** + * @param Request $request + * * @return mixed */ abstract public function beforeSend(Request $request); @@ -88,4 +134,16 @@ abstract public function beforeSend(Request $request); * @return mixed */ abstract public function getAPIClientName(); + + /** + * @param $message + * + * @return array + */ + abstract public function createAPIError($message); + + /** + * @return mixed + */ + abstract public function getEndpoint(); } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/API/AbstractPluginActions.php b/vendor/cloudflare/cloudflare-plugin-backend/src/API/AbstractPluginActions.php new file mode 100644 index 00000000..4690f4df --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/API/AbstractPluginActions.php @@ -0,0 +1,202 @@ +api = $api; + $this->config = $defaultIntegration->getConfig(); + $this->integrationAPI = $defaultIntegration->getIntegrationAPI(); + $this->dataStore = $defaultIntegration->getDataStore(); + $this->logger = $defaultIntegration->getLogger(); + $this->request = $request; + + $this->clientAPI = new Client($defaultIntegration); + } + + /** + * @param APIInterface $api + */ + public function setAPI(APIInterface $api) { + $this->api = $api; + } + + /** + * @param Request $request + */ + public function setRequest(Request $request) { + $this->request = $request; + } + + /** + * @param APIInterface $clientAPI + */ + public function setClientAPI(APIInterface $clientAPI) { + $this->clientAPI = $clientAPI; + } + + /** + * @param DataStoreInterface $dataStore + */ + public function setDataStore(DataStoreInterface $dataStore) { + $this->dataStore = $dataStore; + } + + public function setLogger(\Psr\Log\LoggerInterface $logger) { + $this->logger = $logger; + } + + /** + * POST /account. + * + * @return mixed + */ + public function login() + { + $requestBody = $this->request->getBody(); + if(empty($requestBody["apiKey"])) { + return $this->api->createAPIError("Missing required parameter: 'apiKey'."); + } + if(empty($requestBody["email"])) { + return $this->api->createAPIError("Missing required parameter: 'email'."); + } + + $isCreated = $this->dataStore->createUserDataStore($requestBody["apiKey"], $requestBody["email"], null, null); + + if (!$isCreated) { + $this->logger->error('Creating user data to store failed'); + + return $this->api->createAPIError('Unable to save user credentials'); + } + + $response = $this->api->createAPISuccessResponse(array('email' => $requestBody["email"])); + + return $response; + } + + /** + * GET /plugin/:zonedId/settings. + * + * @return mixed + */ + public function getPluginSettings() + { + $settingsList = Plugin::getPluginSettingsKeys(); + + $formattedSettings = array(); + foreach ($settingsList as $setting) { + $value = $this->dataStore->get($setting); + array_push($formattedSettings, $this->api->createPluginResult($setting, $value, true, '')); + } + + $response = $this->api->createAPISuccessResponse( + $formattedSettings + ); + + return $response; + } + + /** + * PATCH /plugin/:zonedId/settings/:settingId. + * + * Routes custom settingIds and default settingsIds + * to different functions + * + * @return mixed + */ + public function patchPluginSettingsRouter() + { + $path_array = explode('/', $this->request->getUrl()); + $settingId = $path_array[3]; + + $response = null; + if ($settingId === Plugin::SETTING_DEFAULT_SETTINGS) { + $response = $this->patchPluginDefaultSettings(); + } else { + $response = $this->patchPluginSettings(); + } + + return $response; + } + + /** + * For PATCH /plugin/:zonedId/settings/:settingId where :settingId is not predefined. + * + * @return mixed + */ + public function patchPluginSettings() + { + $path_array = explode('/', $this->request->getUrl()); + $settingId = $path_array[3]; + + $value = $this->request->getBody()['value']; + $options = $this->dataStore->set($settingId, $value); + + if (!isset($options)) { + return $this->api->createAPIError('Unable to update plugin settings'); + } + + $response = $this->api->createAPISuccessResponse( + array( + $this->api->createPluginResult($settingId, $value, true, ''), + ) + ); + + return $response; + } + + /** + * For PATCH /plugin/:zonedId/settings/:settingId where :settingId is Plugin::SETTING_DEFAULT_SETTINGS. + * @return mixed + * @throws \Exception + */ + public function patchPluginDefaultSettings() + { + $this->dataStore->set(Plugin::SETTING_DEFAULT_SETTINGS, true); + + try { + $this->applyDefaultSettings(); + } catch(\Exception $e) { + if($e instanceof Exception\CloudFlareException) { + return $this->api->createAPIError($e->getMessage()); + } else { + throw $e; + } + } + + + return $this->api->createAPISuccessResponse( + array( + $this->api->createPluginResult(Plugin::SETTING_DEFAULT_SETTINGS, "on", true, ''), + ) + ); + } + + /** + * Children should implement this method to apply the plugin specific default settings + * + * @return mixed + */ + public abstract function applyDefaultSettings(); +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/API/Client.php b/vendor/cloudflare/cloudflare-plugin-backend/src/API/Client.php index 8f0e8774..2405c9ee 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/API/Client.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/API/Client.php @@ -1,18 +1,19 @@ $this->data_store->getClientV4APIKey(), self::X_AUTH_EMAIL => $this->data_store->getCloudFlareEmail(), - self::CONTENT_TYPE_KEY => self::APPLICATION_JSON_KEY + self::CONTENT_TYPE_KEY => self::APPLICATION_JSON_KEY, ); $request->setHeaders($headers); @@ -29,11 +30,13 @@ public function beforeSend(Request $request) /** * @param $message + * * @return array */ public function createAPIError($message) { $this->logger->error($message); + return array( 'result' => null, 'success' => false, @@ -41,19 +44,37 @@ public function createAPIError($message) array( 'code' => '', 'message' => $message, - ) + ), ), - 'messages' => array() + 'messages' => array(), ); } + /** + * @param RequestException error + * + * @return string + */ + public function getErrorMessage(RequestException $error) + { + $jsonResponse = json_decode($error->getResponse()->getBody(), true); + $errorMessage = $error->getMessage(); + + if (count($jsonResponse['errors']) > 0) { + $errorMessage = $jsonResponse['errors'][0]['message']; + } + + return $errorMessage; + } + /** * @param $response + * * @return bool */ public function responseOk($response) { - return ($response["success"] === true); + return $response['success'] === true; } /** @@ -73,13 +94,16 @@ public function getAPIClientName() } /** - * GET /zones/:id + * GET /zones/:id. + * * @param $zone_tag + * * @return string */ public function zoneGetDetails($zone_tag) { - $request = new Request("GET", "zones/" . $zone_tag, array(), array()); + $request = new Request('GET', 'zones/'.$zone_tag, array(), array()); + return $this->callAPI($request); } } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/API/Exception/CloudFlareException.php b/vendor/cloudflare/cloudflare-plugin-backend/src/API/Exception/CloudFlareException.php new file mode 100644 index 00000000..055c2c41 --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/API/Exception/CloudFlareException.php @@ -0,0 +1,8 @@ +setUrl(self::ENDPOINT_PATH); $headers = array( - self::CF_INTEGRATION_HEADER => $this->config->getValue("integrationName"), - self::CF_INTEGRTATION_VERSION_HEADER => $this->config->getValue("version"), + self::CF_INTEGRATION_HEADER => $this->config->getValue('integrationName'), + self::CF_INTEGRTATION_VERSION_HEADER => $this->config->getValue('version'), ); $request->setHeaders($headers); $body = $request->getBody(); $user_key_actions = array('zone_set', 'full_zone_set'); if (in_array(strtolower($body['act']), $user_key_actions)) { - $body["user_key"] = $this->data_store->getHostAPIUserKey(); + $body['user_key'] = $this->data_store->getHostAPIUserKey(); } $body['host_key'] = $this->integrationAPI->getHostAPIKey(); $request->setBody($body); @@ -43,11 +41,21 @@ public function beforeSend(Request $request) /** * @param $host_api_response + * * @return bool */ public function responseOk($host_api_response) { - return ($host_api_response['result'] === 'success'); + return $host_api_response['result'] === 'success'; + } + + /** + * @param Request $request + * @return mixed + */ + public function getPath(Request $request) + { + return $request->getBody()['act']; } /** @@ -68,17 +76,26 @@ public function getAPIClientName() /** * @param $message + * * @return array */ public function createAPIError($message) { return array( 'request' => array( - 'act' => '' + 'act' => '', ), 'result' => 'error', 'msg' => $message, - 'err_code' => '' + 'err_code' => '', ); } + + /** + * @param Request $request + * @return bool + */ + function shouldRouteRequest(Request $request) { + return ($request->getUrl() === $this->getEndpoint()); + } } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/API/Plugin.php b/vendor/cloudflare/cloudflare-plugin-backend/src/API/Plugin.php new file mode 100644 index 00000000..baeddeac --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/API/Plugin.php @@ -0,0 +1,72 @@ +logger->error('CF\\Wordpress\\API\\Plugin\\callAPI should never be called'); + + return $this->createAPIError('The url: '.$request->getUrl().' is not a valid path.'); + } + + public function createAPISuccessResponse($result) + { + return array( + 'success' => true, + 'result' => $result, + 'messages' => [], + 'errors' => [], + ); + } + + public function createPluginResult($id, $value, $editable, $modified_on) + { + return array( + 'id' => $id, + 'value' => $value, + 'editable' => $editable, + 'modified_on' => $modified_on, + ); + } +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/API/PluginRoutes.php b/vendor/cloudflare/cloudflare-plugin-backend/src/API/PluginRoutes.php new file mode 100644 index 00000000..1ce2ceee --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/API/PluginRoutes.php @@ -0,0 +1,35 @@ + array( + 'class' => 'CF\API\AbstractPluginActions', + 'methods' => array( + 'POST' => array( + 'function' => 'login', + ), + ), + ), + + 'plugin/:id/settings' => array( + 'class' => 'CF\API\AbstractPluginActions', + 'methods' => array( + 'GET' => array( + 'function' => 'getPluginSettings', + ), + ), + ), + + 'plugin/:id/settings/:human_readable_id' => array( + 'class' => 'CF\API\AbstractPluginActions', + 'methods' => array( + 'PATCH' => array( + 'function' => 'patchPluginSettingsRouter', + ), + ), + ), + ); +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/API/Request.php b/vendor/cloudflare/cloudflare-plugin-backend/src/API/Request.php index 6bdcda89..6faf8669 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/API/Request.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/API/Request.php @@ -4,7 +4,6 @@ class Request { - private $method; private $url; private $parameters; diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/DNSRecord.php b/vendor/cloudflare/cloudflare-plugin-backend/src/DNSRecord.php index d7a7ab52..d28dbf01 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/DNSRecord.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/DNSRecord.php @@ -3,7 +3,7 @@ * Created by IntelliJ IDEA. * User: johnwineman * Date: 4/18/16 - * Time: 2:40 PM + * Time: 2:40 PM. */ namespace CF; diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/ConfigInterface.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/ConfigInterface.php index 87e8d0a8..447d9b7e 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/ConfigInterface.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/ConfigInterface.php @@ -4,9 +4,9 @@ interface ConfigInterface { - /** * @param $key + * * @return mixed */ public function getValue($key); diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DataStoreInterface.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DataStoreInterface.php index c5591d1d..faac2679 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DataStoreInterface.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DataStoreInterface.php @@ -4,12 +4,12 @@ interface DataStoreInterface { - /** * @param $client_api_key * @param $email * @param $unique_id * @param $user_key + * * @return mixed */ public function createUserDataStore($client_api_key, $email, $unique_id, $user_key); @@ -33,4 +33,17 @@ public function getHostAPIUserKey(); * @return mixed */ public function getCloudFlareEmail(); + + /** + * @param $key + * @return mixed + */ + public function get($key); + + /** + * @param $key + * @param $value + * @return mixed + */ + public function set($key, $value); } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultConfig.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultConfig.php index e2b9a265..a4eb5a30 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultConfig.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultConfig.php @@ -1,4 +1,5 @@ config)) { $value = $this->config[$key]; } + return $value; } } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultIntegration.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultIntegration.php index c8227c0a..35fb4d04 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultIntegration.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultIntegration.php @@ -2,6 +2,7 @@ namespace CF\Integration; +use Psr\Log\LoggerInterface; class DefaultIntegration implements IntegrationInterface { @@ -11,10 +12,10 @@ class DefaultIntegration implements IntegrationInterface private $logger; /** - * @param ConfigInterface $config - * @param IntegrationAPIInterface $integrationAPI - * @param DataStoreInterface $dataStore - * @param LoggerInterface $logger + * @param ConfigInterface $config + * @param IntegrationAPIInterface $integrationAPI + * @param DataStoreInterface $dataStore + * @param LoggerInterface|\Psr\Log\LoggerInterface $logger */ public function __construct(ConfigInterface $config, IntegrationAPIInterface $integrationAPI, DataStoreInterface $dataStore, LoggerInterface $logger) { @@ -87,4 +88,4 @@ public function setLogger(LoggerInterface $logger) { $this->logger = $logger; } -} \ No newline at end of file +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultLogger.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultLogger.php index 42dd3f11..1958e699 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultLogger.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/DefaultLogger.php @@ -1,14 +1,16 @@ debug) { - return $this->log(LogLevel::DEBUG, $message, $context); - } - } - - public function logAPICall($api, $message, $is_debug) - { - - $log_level = "error"; - if ($is_debug) { - $log_level = "debug"; + if ($this->debug) { + return $this->log(LogLevel::DEBUG, $message, $context); } - - if (!is_string($message)) { - $message = print_r($message, true); - } - - $this->$log_level("[" . $api . "] " . $message); } } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/IntegrationAPIInterface.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/IntegrationAPIInterface.php index a22eecd6..517cbb18 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/IntegrationAPIInterface.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/IntegrationAPIInterface.php @@ -6,9 +6,9 @@ interface IntegrationAPIInterface { - /** * @param $domain_name + * * @return mixed */ public function getDNSRecords($domain_name); @@ -16,6 +16,7 @@ public function getDNSRecords($domain_name); /** * @param $domain_name * @param DNSRecord $DNSRecord + * * @return mixed */ public function addDNSRecord($domain_name, DNSRecord $DNSRecord); @@ -23,6 +24,7 @@ public function addDNSRecord($domain_name, DNSRecord $DNSRecord); /** * @param $domain_name * @param DNSRecord $DNSRecord + * * @return mixed */ public function editDNSRecord($domain_name, DNSRecord $DNSRecord); @@ -30,6 +32,7 @@ public function editDNSRecord($domain_name, DNSRecord $DNSRecord); /** * @param $domain_name * @param DNSRecord $DNSRecord + * * @return mixed */ public function removeDNSRecord($domain_name, DNSRecord $DNSRecord); @@ -41,6 +44,7 @@ public function getHostAPIKey(); /** * @param null $userId + * * @return mixed */ public function getDomainList($userId = null); diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/LoggerInterface.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/LoggerInterface.php deleted file mode 100644 index 5bb323f0..00000000 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Integration/LoggerInterface.php +++ /dev/null @@ -1,14 +0,0 @@ - "[0-9a-z]{32}", - ":bigint_id" => "[0-9]{1,19}", - ":human_readable_id" => "[-0-9a-z_]{1,120}", - ":rayid" => "[0-9a-z]{16}", - ":firewall_rule_id" => "[0-9a-zA-Z\\-_]{1,160}", - ":file_name" => "[0-9A-Za-z_\\.\\-]{1,120}", - ":uuid" => "[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}" + ':id' => '[0-9a-z]{32}', + ':bigint_id' => '[0-9]{1,19}', + ':human_readable_id' => '[-0-9a-z_]{1,120}', + ':rayid' => '[0-9a-z]{16}', + ':firewall_rule_id' => '[0-9a-zA-Z\\-_]{1,160}', + ':file_name' => '[0-9A-Za-z_\\.\\-]{1,120}', + ':uuid' => '[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}', ); - /** * @param IntegrationInterface $integration - * @param APIInterface $api + * @param APIInterface $api * @param $routes */ public function __construct(IntegrationInterface $integration, APIInterface $api, $routes) @@ -45,20 +44,21 @@ public function __construct(IntegrationInterface $integration, APIInterface $api $this->routes = $routes; } - /** * @param Request $request + * * @return mixed */ public function route(Request $request) { - $request->setUrl($this->getPath($request)); + $request->setUrl($this->api->getPath($request)); $routeParameters = $this->getRoute($request); if ($routeParameters) { $class = $routeParameters['class']; $function = $routeParameters['function']; $routeClass = new $class($this->integration, $this->api, $request); + return $routeClass->$function(); } else { return $this->api->callAPI($request); @@ -67,6 +67,7 @@ public function route(Request $request) /** * @param Request $request + * * @return string */ public function getPath(Request $request) @@ -74,10 +75,10 @@ public function getPath(Request $request) //substring of everything after the endpoint is the path return substr($request->getUrl(), strpos($request->getUrl(), $this->api->getEndpoint()) + strlen($this->api->getEndpoint())); } - - + /** * @param Request $request + * * @return array|bool */ public function getRoute(Request $request) @@ -97,16 +98,17 @@ public function getRoute(Request $request) ); //Check to see if this is our route - if (preg_match('#^' . $regex . '/?$#', $request->getUrl())) { - if (in_array($request->getMethod(), $route_details_array["methods"]) || array_key_exists( + if (preg_match('#^'.$regex.'/?$#', $request->getUrl())) { + if (in_array($request->getMethod(), $route_details_array['methods']) || array_key_exists( $request->getMethod(), - $route_details_array["methods"] + $route_details_array['methods'] ) ) { - $this->logger->debug("Route matched for " . $request->getMethod() . $request->getUrl() . " now using " . $route_details_array["methods"][$request->getMethod()]['function']); + $this->logger->debug('Route matched for '.$request->getMethod().$request->getUrl().' now using '.$route_details_array['methods'][$request->getMethod()]['function']); + return array( - 'class' => $route_details_array["class"], - 'function' => $route_details_array["methods"][$request->getMethod()]['function'] + 'class' => $route_details_array['class'], + 'function' => $route_details_array['methods'][$request->getMethod()]['function'], ); } } @@ -124,7 +126,6 @@ public function getAPIClient() return $this->api; } - /** * @param $routes */ diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Router/HostAPIRouter.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Router/HostAPIRouter.php deleted file mode 100644 index c9ef803f..00000000 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Router/HostAPIRouter.php +++ /dev/null @@ -1,18 +0,0 @@ -getBody()['act']; - } -} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Router/RequestRouter.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Router/RequestRouter.php new file mode 100644 index 00000000..53fcdfc2 --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Router/RequestRouter.php @@ -0,0 +1,62 @@ +integrationContext = $integrationContext; + $this->routerList = array(); + } + + /** + * @param $clientClassName + * @param $routes + */ + public function addRouter($clientClassName, $routes) { + $client = new $clientClassName($this->integrationContext); + $router = new DefaultRestAPIRouter($this->integrationContext, $client, $routes); + $this->routerList[$client->getAPIClientName()] = $router; + } + + /** + * @return array + */ + public function getRouterList() { + return $this->routerList; + } + + + /** + * @param $routerList + */ + public function setRouterList($routerList) { + $this->routerList = $routerList; + } + + /** + * @param Request $request + * @return bool + */ + public function route(Request $request) { + foreach($this->getRouterList() as $router) { + if($router->getAPIClient()->shouldRouteRequest($request)) { + return $router->route($request); + } + } + + return null; + } +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Router/RouterInterface.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Router/RouterInterface.php index 4b9d7254..4636f805 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Router/RouterInterface.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Router/RouterInterface.php @@ -8,5 +8,4 @@ interface RouterInterface { public function route(Request $request); public function getAPIClient(); - public function getPath(Request $request); } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/SecurityUtil.php b/vendor/cloudflare/cloudflare-plugin-backend/src/SecurityUtil.php index 54deac3b..aded1a49 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/SecurityUtil.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/SecurityUtil.php @@ -4,7 +4,6 @@ class SecurityUtil { - /** * @return bool|string */ @@ -12,10 +11,10 @@ public static function generate16bytesOfSecureRandomData() { if (function_exists('random_bytes')) { $randBytes = random_bytes(16); - } else if (function_exists('mcrypt_create_iv')) { + } elseif (function_exists('mcrypt_create_iv')) { srand(); $randBytes = mcrypt_create_iv(16); - } else if (function_exists('openssl_random_pseudo_bytes')) { + } elseif (function_exists('openssl_random_pseudo_bytes')) { $wasItSecure = false; $randBytes = openssl_random_pseudo_bytes(16, $wasItSecure); if ($wasItSecure === false) { @@ -24,6 +23,7 @@ public static function generate16bytesOfSecureRandomData() } else { return false; } + return bin2hex($randBytes); } @@ -31,6 +31,7 @@ public static function generate16bytesOfSecureRandomData() * @param $secret - string a cryptographically strong secret * @param $user - string a piece of unique user data * @param $timeValidUntil - int of time the token will be valid for in seconds + * * @return string */ public static function csrfTokenGenerate($secret, $user, $timeValidUntil = null) @@ -38,29 +39,31 @@ public static function csrfTokenGenerate($secret, $user, $timeValidUntil = null) if ($timeValidUntil === null) { $timeValidUntil = time() + 86400; } - $hashedSecret = hash("sha512", $secret); - $dataToHash = sprintf("%s-%s-%s", $hashedSecret, $user, $timeValidUntil); + $hashedSecret = hash('sha512', $secret); + $dataToHash = sprintf('%s-%s-%s', $hashedSecret, $user, $timeValidUntil); $hashedData = static::hashFunction($dataToHash); - return sprintf("%s-%s", $timeValidUntil, $hashedData); + + return sprintf('%s-%s', $timeValidUntil, $hashedData); } /** * @param $secret - string a cryptographically strong secret * @param $user - string a piece of unique user data * @param $token- string the token that needs to be validated. + * * @return bool */ public static function csrfTokenValidate($secret, $user, $token) { - $tokenParts = explode("-", $token); + $tokenParts = explode('-', $token); if (count($tokenParts) !== 2) { return false; } list($timeValidFor, $hash) = $tokenParts; - $hashedSecret = hash("sha512", $secret); - $dataToHash = sprintf("%s-%s-%s", $hashedSecret, $user, $timeValidFor); + $hashedSecret = hash('sha512', $secret); + $dataToHash = sprintf('%s-%s-%s', $hashedSecret, $user, $timeValidFor); $newHash = static::hashFunction($dataToHash); if ($newHash !== $hash) { return false; @@ -68,16 +71,19 @@ public static function csrfTokenValidate($secret, $user, $token) if (time() > $timeValidFor) { return false; } + return true; } /** * @param $data - string the data that will be hashed. + * * @return string */ private static function hashFunction($data) { - $hash = hash("sha512", $data); + $hash = hash('sha512', $data); + return substr($hash, 64); } } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/AbstractAPIClientTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/AbstractAPIClientTest.php new file mode 100644 index 00000000..38bc4325 --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/AbstractAPIClientTest.php @@ -0,0 +1,42 @@ +mockRequest = $this->getMockBuilder('CF\API\Request') + ->disableOriginalConstructor() + ->getMock(); + + $this->mockAbstractAPIClient = $this->getMockBuilder('CF\API\AbstractAPIClient') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + } + + public function testGetPathReturnsPath() { + $endpoint = "http://api.cloudflare.com/client/v4"; + $path = "/zones"; + $this->mockRequest->method('getUrl')->willReturn($endpoint.$path); + $this->mockAbstractAPIClient->method('getEndpoint')->willReturn($endpoint); + $this->assertEquals($path, $this->mockAbstractAPIClient->getPath($this->mockRequest)); + } + + public function testShouldRouteRequestReturnsTrueForValidRequest() { + $endpoint = "http://api.cloudflare.com/client/v4"; + $url = $endpoint."/zones"; + $this->mockRequest->method('getUrl')->willReturn($url); + $this->mockAbstractAPIClient->method('getEndpoint')->willReturn($endpoint); + $this->assertTrue($this->mockAbstractAPIClient->shouldRouteRequest($this->mockRequest)); + } + + public function testShouldRouteRequestReturnsFalseForInvalidRequest() { + $this->mockRequest->method('getUrl')->willReturn("http://api.cloudflare.com/client/v4/zones"); + $this->mockAbstractAPIClient->method('getEndpoint')->willReturn("https://api.cloudflare.com/host-gw.html"); + $this->assertFalse($this->mockAbstractAPIClient->shouldRouteRequest($this->mockRequest)); + } +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/AbstractPluginActionsTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/AbstractPluginActionsTest.php new file mode 100644 index 00000000..2f0ae0eb --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/AbstractPluginActionsTest.php @@ -0,0 +1,91 @@ +mockAPIClient = $this->getMockBuilder('\CF\API\Plugin') + ->disableOriginalConstructor() + ->getMock(); + $this->mockClientAPI = $this->getMockBuilder('\CF\API\Client') + ->disableOriginalConstructor() + ->getMock(); + $this->mockDataStore = $this->getMockBuilder('\CF\Integration\DataStoreInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->mockLogger = $this->getMockBuilder('\Psr\Log\LoggerInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->mockRequest = $this->getMockBuilder('\CF\API\Request') + ->disableOriginalConstructor() + ->getMock(); + $this->mockAbstractPluginActions = $this->getMockBuilder('CF\API\AbstractPluginActions') + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $this->mockAbstractPluginActions->setRequest($this->mockRequest); + $this->mockAbstractPluginActions->setAPI($this->mockAPIClient); + $this->mockAbstractPluginActions->setClientAPI($this->mockClientAPI); + $this->mockAbstractPluginActions->setDataStore($this->mockDataStore); + $this->mockAbstractPluginActions->setLogger($this->mockLogger); + + } + + public function testPostAccountSaveAPICredentialsReturnsErrorIfMissingApiKey() { + $this->mockRequest->method('getBody')->willReturn(array( + 'email' => 'email' + )); + $this->mockAPIClient->method('createAPIError')->willReturn(array('success' => false)); + + $response = $this->mockAbstractPluginActions->login(); + + $this->assertFalse($response['success']); + } + + public function testPostAccountSaveAPICredentialsReturnsErrorIfMissingEmail() { + $this->mockRequest->method('getBody')->willReturn(array( + 'apiKey' => 'apiKey' + )); + $this->mockAPIClient->method('createAPIError')->willReturn(array('success' => false)); + + $response = $this->mockAbstractPluginActions->login(); + + $this->assertFalse($response['success']); + } + + public function testPostAccountSaveAPICredentialsReturnsDataStoreEmailIfSuccessful() { + $email = "email"; + $this->mockRequest->method('getBody')->willReturn(array( + 'apiKey' => 'apiKey', + $email => $email + )); + $this->mockAPIClient->method('createAPISuccessResponse')->willReturn(array('email' => $email)); + $this->mockAbstractPluginActions->login(); + } + + public function testGetPluginSettingsReturnsArray() { + $this->mockAPIClient + ->expects($this->once()) + ->method('createAPISuccessResponse') + ->will($this->returnCallback(function($input) { + $this->assertTrue(is_array($input)); + })); + $this->mockAbstractPluginActions->getPluginSettings(); + } + + public function testPatchPluginSettingsReturnsErrorForBadSetting() { + $this->mockRequest->method('getUrl')->willReturn('plugin/:id/settings/nonExistentSetting'); + $this->mockAPIClient->expects($this->once())->method('createAPIError'); + $this->mockAbstractPluginActions->patchPluginSettings(); + } +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/ClientTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/ClientTest.php index 00ba48be..2bb7904f 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/ClientTest.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/ClientTest.php @@ -32,9 +32,10 @@ public function setup() $this->mockClientAPI = new Client($this->mockCpanelIntegration); } - public function testBeforeSendAddsRequestHeaders() { - $apiKey = "apiKey"; - $email = "email"; + public function testBeforeSendAddsRequestHeaders() + { + $apiKey = 'apiKey'; + $email = 'email'; $this->mockDataStore->method('getClientV4APIKey')->willReturn($apiKey); $this->mockDataStore->method('getCloudFlareEmail')->willReturn($email); @@ -46,7 +47,7 @@ public function testBeforeSendAddsRequestHeaders() { $expectedRequestHeaders = array( Client::X_AUTH_KEY => $apiKey, Client::X_AUTH_EMAIL => $email, - Client::CONTENT_TYPE_KEY => Client::APPLICATION_JSON_KEY + Client::CONTENT_TYPE_KEY => Client::APPLICATION_JSON_KEY, ); $this->assertEquals($expectedRequestHeaders[Client::X_AUTH_KEY], $actualRequestHeaders[Client::X_AUTH_KEY]); @@ -63,20 +64,53 @@ public function testClientApiErrorReturnsValidStructure() array( 'code' => '', 'message' => 'Test Message', - ) + ), ), - 'messages' => array() + 'messages' => array(), ); - $errorResponse = $this->mockClientAPI->createAPIError("Test Message"); + $errorResponse = $this->mockClientAPI->createAPIError('Test Message'); $this->assertEquals($errorResponse, $expectedErrorResponse); } public function testResponseOkReturnsTrueForValidResponse() { $v4APIResponse = array( - "success" => true + 'success' => true, ); $this->assertTrue($this->mockClientAPI->responseOk($v4APIResponse)); } + + public function testGetErrorMessageSuccess() + { + $errorMessage = 'I am an error message'; + + $error = $this->getMockBuilder('GuzzleHttp\Exception\RequestException') + ->disableOriginalConstructor() + ->setMethods(array('getResponse', 'getBody', 'getMessage')) + ->getMock(); + + $errorJSON = json_encode( + array( + 'success' => false, + 'errors' => array( + array( + 'message' => $errorMessage, + ), + ), + ) + ); + + $error->expects($this->any()) + ->method('getMessage') + ->will($this->returnValue('Not this message')); + $error->expects($this->any()) + ->method('getResponse') + ->will($this->returnSelf()); + $error->expects($this->any()) + ->method('getBody') + ->will($this->returnValue($errorJSON)); + + $this->assertEquals($errorMessage, $this->mockClientAPI->getErrorMessage($error)); + } } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/HostTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/HostTest.php index b32be9fc..38ca93f7 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/HostTest.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/HostTest.php @@ -20,7 +20,7 @@ public function setup() $this->mockConfig = $this->getMockBuilder('CF\Integration\DefaultConfig') ->disableOriginalConstructor() ->getMock(); - $this->mockAPI= $this->getMockBuilder('CF\Integration\IntegrationAPIInterface') + $this->mockAPI = $this->getMockBuilder('CF\Integration\IntegrationAPIInterface') ->disableOriginalConstructor() ->getMock(); $this->mockDataStore = $this->getMockBuilder('CF\Integration\DataStoreInterface') @@ -32,8 +32,6 @@ public function setup() $this->mockCpanelIntegration = new DefaultIntegration($this->mockConfig, $this->mockAPI, $this->mockDataStore, $this->mockLogger); $this->hostAPI = new Host($this->mockCpanelIntegration); - - } public function testBeforeSendSetsCorrectPath() @@ -44,17 +42,19 @@ public function testBeforeSendSetsCorrectPath() $this->assertEquals(Host::ENDPOINT_PATH, $request->getUrl()); } - public function testBeforeSendSetsIntegrationHeaders() { - $integrationName = "integrationName"; - $version = "version"; + public function testBeforeSendSetsIntegrationHeaders() + { + $integrationName = 'integrationName'; + $version = 'version'; $this->mockConfig->method('getValue')->will( $this->returnValueMap( array( array($integrationName, $integrationName), - array($version, $version) + array($version, $version), ) - )); + ) + ); $request = new Request(null, null, null, null); $request = $this->hostAPI->beforeSend($request); @@ -65,8 +65,9 @@ public function testBeforeSendSetsIntegrationHeaders() { $this->assertEquals($version, $requestHeaders[Host::CF_INTEGRTATION_VERSION_HEADER]); } - public function testBeforeSendSetsUserKeyforActZoneSet() { - $userKey = "userKey"; + public function testBeforeSendSetsUserKeyforActZoneSet() + { + $userKey = 'userKey'; $this->mockDataStore->method('getHostAPIUserKey')->willReturn($userKey); $request = new Request(null, null, null, array('act' => 'zone_set')); @@ -75,11 +76,11 @@ public function testBeforeSendSetsUserKeyforActZoneSet() { $requestBody = $request->getBody(); $this->assertEquals($userKey, $requestBody['user_key']); - } - public function testBeforeSendSetsUserKeyforActFullZoneSet() { - $userKey = "userKey"; + public function testBeforeSendSetsUserKeyforActFullZoneSet() + { + $userKey = 'userKey'; $this->mockDataStore->method('getHostAPIUserKey')->willReturn($userKey); $request = new Request(null, null, null, array('act' => 'full_zone_set')); @@ -88,11 +89,11 @@ public function testBeforeSendSetsUserKeyforActFullZoneSet() { $requestBody = $request->getBody(); $this->assertEquals($userKey, $requestBody['user_key']); - } - public function testBeforeSendSetsHostKey() { - $hostKey = "hostKey"; + public function testBeforeSendSetsHostKey() + { + $hostKey = 'hostKey'; $this->mockAPI->method('getHostAPIKey')->willReturn($hostKey); $request = new Request(null, null, null, null); @@ -101,13 +102,12 @@ public function testBeforeSendSetsHostKey() { $requestBody = $request->getBody(); $this->assertEquals($hostKey, $requestBody['host_key']); - } public function testResponseOkReturnsTrueForValidResponse() { $hostAPIResponse = array( - 'result' => 'success' + 'result' => 'success', ); $this->assertTrue($this->hostAPI->responseOk($hostAPIResponse)); @@ -115,11 +115,22 @@ public function testResponseOkReturnsTrueForValidResponse() public function testClientApiErrorReturnsValidStructure() { - $message = "message"; + $message = 'message'; $errorResponse = $this->hostAPI->createAPIError($message); - $this->assertEquals($message, $errorResponse["msg"]); - $this->assertEquals("error", $errorResponse["result"]); + $this->assertEquals($message, $errorResponse['msg']); + $this->assertEquals('error', $errorResponse['result']); + } + + public function testGetPathReturnsBodyActParameter() { + $act = "act"; + $request = new Request(null,null,null,array($act => $act)); + $this->assertEquals($act, $this->hostAPI->getPath($request)); + } + + public function testShouldRouteRequestReturnsTrueIfUrlsAreEqual() { + $request = new Request(null,Host::ENDPOINT,null,null); + $this->assertTrue($this->hostAPI->shouldRouteRequest($request)); } -} \ No newline at end of file +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/PluginTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/PluginTest.php new file mode 100644 index 00000000..a0206fba --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/API/PluginTest.php @@ -0,0 +1,65 @@ +mockConfig = $this->getMockBuilder('CF\Integration\DefaultConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->mockWordPressAPI = $this->getMockBuilder('CF\Integration\IntegrationAPIInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->mockDataStore = $this->getMockBuilder('CF\Integration\DataStoreInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->mockLogger = $this->getMockBuilder('CF\Integration\DefaultLogger') + ->disableOriginalConstructor() + ->getMock(); + $this->mockDefaultIntegration = new DefaultIntegration($this->mockConfig, $this->mockWordPressAPI, $this->mockDataStore, $this->mockLogger); + $this->pluginAPIClient = new Plugin($this->mockDefaultIntegration); + } + + public function testCreateAPISuccessResponse() + { + $resultString = 'result'; + $resultArray = array('email' => $resultString); + + $firstResponse = $this->pluginAPIClient->createAPISuccessResponse($resultString); + $secondResponse = $this->pluginAPIClient->createAPISuccessResponse($resultArray); + + $this->assertTrue($firstResponse['success']); + $this->assertTrue($secondResponse['success']); + $this->assertEquals($resultString, $firstResponse['result']); + $this->assertEquals($resultArray, $secondResponse['result']); + } + + public function testCreateAPIErrorReturnsError() + { + $response = $this->pluginAPIClient->createAPIError('error Message'); + + $this->assertFalse($response['success']); + } + + public function testCallAPIReturnsError() + { + $request = new Request(null, null, null, null); + + $response = $this->pluginAPIClient->callAPI($request); + + $this->assertFalse($response['success']); + } +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Integration/DefaultConfigTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Integration/DefaultConfigTest.php index 1cc12da5..2b04db3a 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Integration/DefaultConfigTest.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Integration/DefaultConfigTest.php @@ -6,10 +6,11 @@ class DefaultConfigTest extends \PHPUnit_Framework_TestCase { - public function testGetValueReturnsCorrectValue() { - $key = "key"; - $value = "value"; - $config = new DefaultConfig(json_encode(array($key => $value ))); + public function testGetValueReturnsCorrectValue() + { + $key = 'key'; + $value = 'value'; + $config = new DefaultConfig(json_encode(array($key => $value))); $this->assertEquals($value, $config->getValue($key)); } -} \ No newline at end of file +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Integration/DefaultLoggerTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Integration/DefaultLoggerTest.php index aa541cba..fa9296c1 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Integration/DefaultLoggerTest.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Integration/DefaultLoggerTest.php @@ -6,13 +6,14 @@ class DefaultLoggerTest extends \PHPUnit_Framework_TestCase { - public function testDebugLogOnlyLogsIfDebugIsEnabled() { + public function testDebugLogOnlyLogsIfDebugIsEnabled() + { $logger = new DefaultLogger(true); - $returnValue = $logger->debug(""); + $returnValue = $logger->debug(''); $this->assertTrue($returnValue); $logger = new DefaultLogger(false); - $returnValue = $logger->debug(""); + $returnValue = $logger->debug(''); $this->assertNull($returnValue); } -} \ No newline at end of file +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/DefaultRestAPIRouterTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/DefaultRestAPIRouterTest.php index ce7f2f2a..87593f24 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/DefaultRestAPIRouterTest.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/DefaultRestAPIRouterTest.php @@ -4,11 +4,10 @@ use CF\API\Request; use CF\Integration\DefaultIntegration; -use \CF\Router\DefaultRestAPIRouter; +use CF\Router\DefaultRestAPIRouter; class DefaultRestAPIRouterTest extends \PHPUnit_Framework_TestCase { - private $clientV4APIRouter; private $mockConfig; private $mockClientAPI; @@ -46,26 +45,26 @@ public function testGetRouteReturnsClassFunctionForValidRoute() 'class' => 'testClass', 'methods' => array( 'GET' => array( - 'function' => 'testFunction' - ) - ) - ) + 'function' => 'testFunction', + ), + ), + ), ); $this->clientV4APIRouter->setRoutes($routes); - $request = new Request("GET", "zones", array(), array()); + $request = new Request('GET', 'zones', array(), array()); $response = $this->clientV4APIRouter->getRoute($request); $this->assertEquals(array( 'class' => 'testClass', - 'function' => 'testFunction' + 'function' => 'testFunction', ), $response); } public function testGetRouteReturnsFalseForNoRouteFound() { - $request = new Request("GET", "zones", array(), array()); + $request = new Request('GET', 'zones', array(), array()); $response = $this->clientV4APIRouter->getRoute($request); $this->assertFalse($response); } diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/HostAPIRouterTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/HostAPIRouterTest.php deleted file mode 100644 index 0d6f8681..00000000 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/HostAPIRouterTest.php +++ /dev/null @@ -1,48 +0,0 @@ -mockConfig = $this->getMockBuilder('CF\Integration\DefaultConfig') - ->disableOriginalConstructor() - ->getMock(); - $this->mockClientAPI = $this->getMockBuilder('CF\API\Host') - ->disableOriginalConstructor() - ->getMock(); - $this->mockAPI = $this->getMockBuilder('CF\Integration\IntegrationAPIInterface') - ->disableOriginalConstructor() - ->getMock(); - $this->mockDataStore = $this->getMockBuilder('CF\Integration\DataStoreInterface') - ->disableOriginalConstructor() - ->getMock(); - $this->mockLogger = $this->getMockBuilder('CF\Integration\DefaultLogger') - ->disableOriginalConstructor() - ->getMock(); - $this->mockIntegration = new DefaultIntegration($this->mockConfig, $this->mockAPI, $this->mockDataStore, $this->mockLogger); - $this->hostAPIRouter = new HostAPIRouter($this->mockIntegration, $this->mockClientAPI, $this->mockRoutes); - } - - public function testGetPathReturnsHostAPIActParameter() - { - $request = new Request(null, null, null, array('act' => 'testAction')); - $path = $this->hostAPIRouter->getPath($request); - $this->assertEquals("testAction", $path); - } -} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/RequestRouterTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/RequestRouterTest.php new file mode 100644 index 00000000..0b8a95ee --- /dev/null +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/Router/RequestRouterTest.php @@ -0,0 +1,63 @@ +mockConfig = $this->getMockBuilder('CF\Integration\DefaultConfig') + ->disableOriginalConstructor() + ->getMock(); + $this->mockAPI = $this->getMockBuilder('CF\Integration\IntegrationAPIInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->mockDataStore = $this->getMockBuilder('CF\Integration\DataStoreInterface') + ->disableOriginalConstructor() + ->getMock(); + $this->mockLogger = $this->getMockBuilder('CF\Integration\DefaultLogger') + ->disableOriginalConstructor() + ->getMock(); + $this->mockIntegration = new DefaultIntegration($this->mockConfig, $this->mockAPI, $this->mockDataStore, $this->mockLogger); + + $this->mockRequest = $this->getMockBuilder('CF\API\Request') + ->disableOriginalConstructor() + ->getMock(); + + $this->requestRouter = new RequestRouter($this->mockIntegration); + } + + public function testAddRouterAddsRouter() { + $this->requestRouter->addRouter('CF\API\Client', null); + $this->assertEquals('CF\Router\DefaultRestAPIRouter', get_class($this->requestRouter->getRouterList()[Client::CLIENT_API_NAME])); + } + + public function testRoutePassesValidRequestToDefaultRestAPIRouter() { + $mockDefaultRestAPIRouter = $this->getMockBuilder('CF\Router\DefaultRestAPIRouter') + ->disableOriginalConstructor() + ->getMock(); + $mockAPIClient = $this->getMockBuilder('CF\API\Client') + ->disableOriginalConstructor() + ->getMock(); + $mockAPIClient->method('shouldRouteRequest')->willReturn(true); + $mockDefaultRestAPIRouter->method('getAPIClient')->willReturn($mockAPIClient); + $mockDefaultRestAPIRouter->expects($this->once())->method('route'); + + $this->requestRouter->setRouterList(array($mockDefaultRestAPIRouter)); + + $this->requestRouter->route($this->mockRequest); + + } +} diff --git a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/SecurityUtilTest.php b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/SecurityUtilTest.php index 027450e1..20028aa7 100644 --- a/vendor/cloudflare/cloudflare-plugin-backend/src/Test/SecurityUtilTest.php +++ b/vendor/cloudflare/cloudflare-plugin-backend/src/Test/SecurityUtilTest.php @@ -4,28 +4,27 @@ class SecurityUtilTest extends \PHPUnit_Framework_TestCase { - public function testCSRFTokenValidateReturnsTrueForValidToken() { - $secret = "secret"; - $user = "user"; + $secret = 'secret'; + $user = 'user'; $token = SecurityUtil::csrfTokenGenerate($secret, $user); $this->assertTrue(SecurityUtil::csrfTokenValidate($secret, $user, $token)); } public function testCSRFTokenValidateReturnsFalseForInvalidToken() { - $secret = "secret"; - $user = "user"; + $secret = 'secret'; + $user = 'user'; $timeValidUntil = time() + 86400; $token = SecurityUtil::csrfTokenGenerate($secret, $user, $timeValidUntil); - $this->assertFalse(SecurityUtil::csrfTokenValidate("bad secret", $user, $token)); + $this->assertFalse(SecurityUtil::csrfTokenValidate('bad secret', $user, $token)); } public function testCSRFTokenValidateReturnsFalseForExpiredToken() { - $secret = "secret"; - $user = "user"; + $secret = 'secret'; + $user = 'user'; $timeValidUntil = time() - 1; $token = SecurityUtil::csrfTokenGenerate($secret, $user, $timeValidUntil); $this->assertFalse(SecurityUtil::csrfTokenValidate($secret, $user, $token)); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 9fb7199f..7f9f77d5 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -41,6 +41,7 @@ 'Generic_Sniffs_Formatting_MultipleStatementAlignmentSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php', 'Generic_Sniffs_Formatting_NoSpaceAfterCastSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php', 'Generic_Sniffs_Formatting_SpaceAfterCastSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php', + 'Generic_Sniffs_Formatting_SpaceAfterNotSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php', 'Generic_Sniffs_Functions_CallTimePassByReferenceSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php', 'Generic_Sniffs_Functions_FunctionCallArgumentSpacingSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php', 'Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php', @@ -544,6 +545,7 @@ 'PSR2_Sniffs_Files_ClosingTagSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php', 'PSR2_Sniffs_Files_EndFileNewlineSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php', 'PSR2_Sniffs_Methods_FunctionCallSignatureSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php', + 'PSR2_Sniffs_Methods_FunctionClosingBraceSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php', 'PSR2_Sniffs_Methods_MethodDeclarationSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php', 'PSR2_Sniffs_Namespaces_NamespaceDeclarationSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php', 'PSR2_Sniffs_Namespaces_UseDeclarationSniff' => $vendorDir . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php', diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index a208647d..c7969d4a 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -6,7 +6,6 @@ $baseDir = dirname($vendorDir); return array( - 'phpDocumentor' => array($vendorDir . '/phpdocumentor/reflection-docblock/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log'), 'Prophecy\\' => array($vendorDir . '/phpspec/prophecy/src'), ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 3039a3b8..e2921ffd 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,6 +6,8 @@ $baseDir = dirname($vendorDir); return array( + 'phpDocumentor\\Reflection\\' => array($vendorDir . '/phpdocumentor/reflection-common/src', $vendorDir . '/phpdocumentor/type-resolver/src', $vendorDir . '/phpdocumentor/reflection-docblock/src'), + 'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'), 'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'), 'React\\Promise\\' => array($vendorDir . '/react/promise/src'), 'GuzzleHttp\\Stream\\' => array($vendorDir . '/guzzlehttp/streams/src'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 6b5faf2b..3351618d 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -23,24 +23,35 @@ public static function getLoader() self::$loader = $loader = new \Composer\Autoload\ClassLoader(); spl_autoload_unregister(array('ComposerAutoloaderInitb3afba8d614ff1f43cdd7aeb18613292', 'loadClassLoader')); - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION'); + if ($useStaticLoader) { + require_once __DIR__ . '/autoload_static.php'; - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } + call_user_func(\Composer\Autoload\ComposerStaticInitb3afba8d614ff1f43cdd7aeb18613292::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } } $loader->register(true); - $includeFiles = require __DIR__ . '/autoload_files.php'; + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInitb3afba8d614ff1f43cdd7aeb18613292::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } foreach ($includeFiles as $fileIdentifier => $file) { composerRequireb3afba8d614ff1f43cdd7aeb18613292($fileIdentifier, $file); } diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php new file mode 100644 index 00000000..f396a4b7 --- /dev/null +++ b/vendor/composer/autoload_static.php @@ -0,0 +1,798 @@ + __DIR__ . '/..' . '/react/promise/src/functions_include.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'p' => + array ( + 'phpDocumentor\\Reflection\\' => 25, + ), + 'W' => + array ( + 'Webmozart\\Assert\\' => 17, + ), + 'S' => + array ( + 'Symfony\\Component\\Yaml\\' => 23, + ), + 'R' => + array ( + 'React\\Promise\\' => 14, + ), + 'G' => + array ( + 'GuzzleHttp\\Stream\\' => 18, + 'GuzzleHttp\\Ring\\' => 16, + 'GuzzleHttp\\' => 11, + ), + 'D' => + array ( + 'Doctrine\\Instantiator\\' => 22, + ), + 'C' => + array ( + 'CF\\' => 3, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'phpDocumentor\\Reflection\\' => + array ( + 0 => __DIR__ . '/..' . '/phpdocumentor/reflection-common/src', + 1 => __DIR__ . '/..' . '/phpdocumentor/type-resolver/src', + 2 => __DIR__ . '/..' . '/phpdocumentor/reflection-docblock/src', + ), + 'Webmozart\\Assert\\' => + array ( + 0 => __DIR__ . '/..' . '/webmozart/assert/src', + ), + 'Symfony\\Component\\Yaml\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/yaml', + ), + 'React\\Promise\\' => + array ( + 0 => __DIR__ . '/..' . '/react/promise/src', + ), + 'GuzzleHttp\\Stream\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/streams/src', + ), + 'GuzzleHttp\\Ring\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/ringphp/src', + ), + 'GuzzleHttp\\' => + array ( + 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', + ), + 'Doctrine\\Instantiator\\' => + array ( + 0 => __DIR__ . '/..' . '/doctrine/instantiator/src/Doctrine/Instantiator', + ), + 'CF\\' => + array ( + 0 => __DIR__ . '/../..' . '/src', + 1 => __DIR__ . '/..' . '/cloudflare/cloudflare-plugin-backend/src', + ), + ); + + public static $prefixesPsr0 = array ( + 'P' => + array ( + 'Psr\\Log\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/log', + ), + 'Prophecy\\' => + array ( + 0 => __DIR__ . '/..' . '/phpspec/prophecy/src', + ), + ), + ); + + public static $classMap = array ( + 'File_Iterator' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Iterator.php', + 'File_Iterator_Facade' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Facade.php', + 'File_Iterator_Factory' => __DIR__ . '/..' . '/phpunit/php-file-iterator/src/Factory.php', + 'Generic_Sniffs_Arrays_DisallowLongArraySyntaxSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Arrays/DisallowLongArraySyntaxSniff.php', + 'Generic_Sniffs_Arrays_DisallowShortArraySyntaxSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Arrays/DisallowShortArraySyntaxSniff.php', + 'Generic_Sniffs_Classes_DuplicateClassNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Classes/DuplicateClassNameSniff.php', + 'Generic_Sniffs_CodeAnalysis_EmptyStatementSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/EmptyStatementSniff.php', + 'Generic_Sniffs_CodeAnalysis_ForLoopShouldBeWhileLoopSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/ForLoopShouldBeWhileLoopSniff.php', + 'Generic_Sniffs_CodeAnalysis_ForLoopWithTestFunctionCallSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php', + 'Generic_Sniffs_CodeAnalysis_JumbledIncrementerSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/JumbledIncrementerSniff.php', + 'Generic_Sniffs_CodeAnalysis_UnconditionalIfStatementSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/UnconditionalIfStatementSniff.php', + 'Generic_Sniffs_CodeAnalysis_UnnecessaryFinalModifierSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/UnnecessaryFinalModifierSniff.php', + 'Generic_Sniffs_CodeAnalysis_UnusedFunctionParameterSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/UnusedFunctionParameterSniff.php', + 'Generic_Sniffs_CodeAnalysis_UselessOverridingMethodSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/CodeAnalysis/UselessOverridingMethodSniff.php', + 'Generic_Sniffs_Commenting_DocCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Commenting/DocCommentSniff.php', + 'Generic_Sniffs_Commenting_FixmeSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Commenting/FixmeSniff.php', + 'Generic_Sniffs_Commenting_TodoSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Commenting/TodoSniff.php', + 'Generic_Sniffs_ControlStructures_InlineControlStructureSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php', + 'Generic_Sniffs_Debug_CSSLintSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/CSSLintSniff.php', + 'Generic_Sniffs_Debug_ClosureLinterSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/ClosureLinterSniff.php', + 'Generic_Sniffs_Debug_JSHintSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Debug/JSHintSniff.php', + 'Generic_Sniffs_Files_ByteOrderMarkSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/ByteOrderMarkSniff.php', + 'Generic_Sniffs_Files_EndFileNewlineSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/EndFileNewlineSniff.php', + 'Generic_Sniffs_Files_EndFileNoNewlineSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/EndFileNoNewlineSniff.php', + 'Generic_Sniffs_Files_InlineHTMLSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/InlineHTMLSniff.php', + 'Generic_Sniffs_Files_LineEndingsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/LineEndingsSniff.php', + 'Generic_Sniffs_Files_LineLengthSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/LineLengthSniff.php', + 'Generic_Sniffs_Files_LowercasedFilenameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/LowercasedFilenameSniff.php', + 'Generic_Sniffs_Files_OneClassPerFileSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/OneClassPerFileSniff.php', + 'Generic_Sniffs_Files_OneInterfacePerFileSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/OneInterfacePerFileSniff.php', + 'Generic_Sniffs_Files_OneTraitPerFileSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/OneTraitPerFileSniff.php', + 'Generic_Sniffs_Formatting_DisallowMultipleStatementsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/DisallowMultipleStatementsSniff.php', + 'Generic_Sniffs_Formatting_MultipleStatementAlignmentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php', + 'Generic_Sniffs_Formatting_NoSpaceAfterCastSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/NoSpaceAfterCastSniff.php', + 'Generic_Sniffs_Formatting_SpaceAfterCastSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/SpaceAfterCastSniff.php', + 'Generic_Sniffs_Formatting_SpaceAfterNotSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php', + 'Generic_Sniffs_Functions_CallTimePassByReferenceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php', + 'Generic_Sniffs_Functions_FunctionCallArgumentSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/FunctionCallArgumentSpacingSniff.php', + 'Generic_Sniffs_Functions_OpeningFunctionBraceBsdAllmanSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceBsdAllmanSniff.php', + 'Generic_Sniffs_Functions_OpeningFunctionBraceKernighanRitchieSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php', + 'Generic_Sniffs_Metrics_CyclomaticComplexitySniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Metrics/CyclomaticComplexitySniff.php', + 'Generic_Sniffs_Metrics_NestingLevelSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Metrics/NestingLevelSniff.php', + 'Generic_Sniffs_NamingConventions_CamelCapsFunctionNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/NamingConventions/CamelCapsFunctionNameSniff.php', + 'Generic_Sniffs_NamingConventions_ConstructorNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/NamingConventions/ConstructorNameSniff.php', + 'Generic_Sniffs_NamingConventions_UpperCaseConstantNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/NamingConventions/UpperCaseConstantNameSniff.php', + 'Generic_Sniffs_PHP_CharacterBeforePHPOpeningTagSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/CharacterBeforePHPOpeningTagSniff.php', + 'Generic_Sniffs_PHP_ClosingPHPTagSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/ClosingPHPTagSniff.php', + 'Generic_Sniffs_PHP_DeprecatedFunctionsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/DeprecatedFunctionsSniff.php', + 'Generic_Sniffs_PHP_DisallowShortOpenTagSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/DisallowShortOpenTagSniff.php', + 'Generic_Sniffs_PHP_ForbiddenFunctionsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/ForbiddenFunctionsSniff.php', + 'Generic_Sniffs_PHP_LowerCaseConstantSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/LowerCaseConstantSniff.php', + 'Generic_Sniffs_PHP_LowerCaseKeywordSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php', + 'Generic_Sniffs_PHP_NoSilencedErrorsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/NoSilencedErrorsSniff.php', + 'Generic_Sniffs_PHP_SAPIUsageSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/SAPIUsageSniff.php', + 'Generic_Sniffs_PHP_SyntaxSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/SyntaxSniff.php', + 'Generic_Sniffs_PHP_UpperCaseConstantSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/UpperCaseConstantSniff.php', + 'Generic_Sniffs_Strings_UnnecessaryStringConcatSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Strings/UnnecessaryStringConcatSniff.php', + 'Generic_Sniffs_VersionControl_SubversionPropertiesSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/VersionControl/SubversionPropertiesSniff.php', + 'Generic_Sniffs_WhiteSpace_DisallowSpaceIndentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php', + 'Generic_Sniffs_WhiteSpace_DisallowTabIndentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php', + 'Generic_Sniffs_WhiteSpace_ScopeIndentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php', + 'MySource_Sniffs_CSS_BrowserSpecificStylesSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/CSS/BrowserSpecificStylesSniff.php', + 'MySource_Sniffs_Channels_DisallowSelfActionsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Channels/DisallowSelfActionsSniff.php', + 'MySource_Sniffs_Channels_IncludeOwnSystemSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Channels/IncludeOwnSystemSniff.php', + 'MySource_Sniffs_Channels_IncludeSystemSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Channels/IncludeSystemSniff.php', + 'MySource_Sniffs_Channels_UnusedSystemSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Channels/UnusedSystemSniff.php', + 'MySource_Sniffs_Commenting_FunctionCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Commenting/FunctionCommentSniff.php', + 'MySource_Sniffs_Debug_DebugCodeSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Debug/DebugCodeSniff.php', + 'MySource_Sniffs_Debug_FirebugConsoleSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Debug/FirebugConsoleSniff.php', + 'MySource_Sniffs_Objects_AssignThisSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Objects/AssignThisSniff.php', + 'MySource_Sniffs_Objects_CreateWidgetTypeCallbackSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Objects/CreateWidgetTypeCallbackSniff.php', + 'MySource_Sniffs_Objects_DisallowNewWidgetSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Objects/DisallowNewWidgetSniff.php', + 'MySource_Sniffs_PHP_AjaxNullComparisonSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/PHP/AjaxNullComparisonSniff.php', + 'MySource_Sniffs_PHP_EvalObjectFactorySniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/PHP/EvalObjectFactorySniff.php', + 'MySource_Sniffs_PHP_GetRequestDataSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/PHP/GetRequestDataSniff.php', + 'MySource_Sniffs_PHP_ReturnFunctionValueSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/PHP/ReturnFunctionValueSniff.php', + 'MySource_Sniffs_Strings_JoinStringsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/MySource/Sniffs/Strings/JoinStringsSniff.php', + 'PEAR_Sniffs_Classes_ClassDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Classes/ClassDeclarationSniff.php', + 'PEAR_Sniffs_Commenting_ClassCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php', + 'PEAR_Sniffs_Commenting_FileCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php', + 'PEAR_Sniffs_Commenting_FunctionCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php', + 'PEAR_Sniffs_Commenting_InlineCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/InlineCommentSniff.php', + 'PEAR_Sniffs_ControlStructures_ControlSignatureSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/ControlStructures/ControlSignatureSniff.php', + 'PEAR_Sniffs_ControlStructures_MultiLineConditionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php', + 'PEAR_Sniffs_Files_IncludingFileSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Files/IncludingFileSniff.php', + 'PEAR_Sniffs_Formatting_MultiLineAssignmentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Formatting/MultiLineAssignmentSniff.php', + 'PEAR_Sniffs_Functions_FunctionCallSignatureSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php', + 'PEAR_Sniffs_Functions_FunctionDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php', + 'PEAR_Sniffs_Functions_ValidDefaultValueSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/ValidDefaultValueSniff.php', + 'PEAR_Sniffs_NamingConventions_ValidClassNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidClassNameSniff.php', + 'PEAR_Sniffs_NamingConventions_ValidFunctionNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidFunctionNameSniff.php', + 'PEAR_Sniffs_NamingConventions_ValidVariableNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php', + 'PEAR_Sniffs_WhiteSpace_ObjectOperatorIndentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/WhiteSpace/ObjectOperatorIndentSniff.php', + 'PEAR_Sniffs_WhiteSpace_ScopeClosingBraceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php', + 'PEAR_Sniffs_WhiteSpace_ScopeIndentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/WhiteSpace/ScopeIndentSniff.php', + 'PHPUnit_Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Exception.php', + 'PHPUnit_Extensions_GroupTestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Extensions/GroupTestSuite.php', + 'PHPUnit_Extensions_PhptTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Extensions/PhptTestCase.php', + 'PHPUnit_Extensions_PhptTestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Extensions/PhptTestSuite.php', + 'PHPUnit_Extensions_RepeatedTest' => __DIR__ . '/..' . '/phpunit/phpunit/src/Extensions/RepeatedTest.php', + 'PHPUnit_Extensions_TestDecorator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Extensions/TestDecorator.php', + 'PHPUnit_Extensions_TicketListener' => __DIR__ . '/..' . '/phpunit/phpunit/src/Extensions/TicketListener.php', + 'PHPUnit_Framework_Assert' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Assert.php', + 'PHPUnit_Framework_AssertionFailedError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/AssertionFailedError.php', + 'PHPUnit_Framework_BaseTestListener' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/BaseTestListener.php', + 'PHPUnit_Framework_CodeCoverageException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/CodeCoverageException.php', + 'PHPUnit_Framework_Constraint' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint.php', + 'PHPUnit_Framework_Constraint_And' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/And.php', + 'PHPUnit_Framework_Constraint_ArrayHasKey' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ArrayHasKey.php', + 'PHPUnit_Framework_Constraint_ArraySubset' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ArraySubset.php', + 'PHPUnit_Framework_Constraint_Attribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Attribute.php', + 'PHPUnit_Framework_Constraint_Callback' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Callback.php', + 'PHPUnit_Framework_Constraint_ClassHasAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ClassHasAttribute.php', + 'PHPUnit_Framework_Constraint_ClassHasStaticAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ClassHasStaticAttribute.php', + 'PHPUnit_Framework_Constraint_Composite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Composite.php', + 'PHPUnit_Framework_Constraint_Count' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Count.php', + 'PHPUnit_Framework_Constraint_Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Exception.php', + 'PHPUnit_Framework_Constraint_ExceptionCode' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ExceptionCode.php', + 'PHPUnit_Framework_Constraint_ExceptionMessage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ExceptionMessage.php', + 'PHPUnit_Framework_Constraint_ExceptionMessageRegExp' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ExceptionMessageRegExp.php', + 'PHPUnit_Framework_Constraint_FileExists' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/FileExists.php', + 'PHPUnit_Framework_Constraint_GreaterThan' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/GreaterThan.php', + 'PHPUnit_Framework_Constraint_IsAnything' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsAnything.php', + 'PHPUnit_Framework_Constraint_IsEmpty' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsEmpty.php', + 'PHPUnit_Framework_Constraint_IsEqual' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsEqual.php', + 'PHPUnit_Framework_Constraint_IsFalse' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsFalse.php', + 'PHPUnit_Framework_Constraint_IsIdentical' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsIdentical.php', + 'PHPUnit_Framework_Constraint_IsInstanceOf' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsInstanceOf.php', + 'PHPUnit_Framework_Constraint_IsJson' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsJson.php', + 'PHPUnit_Framework_Constraint_IsNull' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsNull.php', + 'PHPUnit_Framework_Constraint_IsTrue' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsTrue.php', + 'PHPUnit_Framework_Constraint_IsType' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/IsType.php', + 'PHPUnit_Framework_Constraint_JsonMatches' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/JsonMatches.php', + 'PHPUnit_Framework_Constraint_JsonMatches_ErrorMessageProvider' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/JsonMatches/ErrorMessageProvider.php', + 'PHPUnit_Framework_Constraint_LessThan' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/LessThan.php', + 'PHPUnit_Framework_Constraint_Not' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Not.php', + 'PHPUnit_Framework_Constraint_ObjectHasAttribute' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/ObjectHasAttribute.php', + 'PHPUnit_Framework_Constraint_Or' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Or.php', + 'PHPUnit_Framework_Constraint_PCREMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/PCREMatch.php', + 'PHPUnit_Framework_Constraint_SameSize' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/SameSize.php', + 'PHPUnit_Framework_Constraint_StringContains' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/StringContains.php', + 'PHPUnit_Framework_Constraint_StringEndsWith' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/StringEndsWith.php', + 'PHPUnit_Framework_Constraint_StringMatches' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/StringMatches.php', + 'PHPUnit_Framework_Constraint_StringStartsWith' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/StringStartsWith.php', + 'PHPUnit_Framework_Constraint_TraversableContains' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php', + 'PHPUnit_Framework_Constraint_TraversableContainsOnly' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/TraversableContainsOnly.php', + 'PHPUnit_Framework_Constraint_Xor' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Constraint/Xor.php', + 'PHPUnit_Framework_Error' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error.php', + 'PHPUnit_Framework_Error_Deprecated' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Deprecated.php', + 'PHPUnit_Framework_Error_Notice' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Notice.php', + 'PHPUnit_Framework_Error_Warning' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Error/Warning.php', + 'PHPUnit_Framework_Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Exception.php', + 'PHPUnit_Framework_ExceptionWrapper' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/ExceptionWrapper.php', + 'PHPUnit_Framework_ExpectationFailedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/ExpectationFailedException.php', + 'PHPUnit_Framework_IncompleteTest' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/IncompleteTest.php', + 'PHPUnit_Framework_IncompleteTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/IncompleteTestCase.php', + 'PHPUnit_Framework_IncompleteTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/IncompleteTestError.php', + 'PHPUnit_Framework_InvalidCoversTargetError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/InvalidCoversTargetError.php', + 'PHPUnit_Framework_InvalidCoversTargetException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/InvalidCoversTargetException.php', + 'PHPUnit_Framework_MockObject_BadMethodCallException' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Exception/BadMethodCallException.php', + 'PHPUnit_Framework_MockObject_Builder_Identity' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/Identity.php', + 'PHPUnit_Framework_MockObject_Builder_InvocationMocker' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/InvocationMocker.php', + 'PHPUnit_Framework_MockObject_Builder_Match' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/Match.php', + 'PHPUnit_Framework_MockObject_Builder_MethodNameMatch' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/MethodNameMatch.php', + 'PHPUnit_Framework_MockObject_Builder_Namespace' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/Namespace.php', + 'PHPUnit_Framework_MockObject_Builder_ParametersMatch' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/ParametersMatch.php', + 'PHPUnit_Framework_MockObject_Builder_Stub' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Builder/Stub.php', + 'PHPUnit_Framework_MockObject_Exception' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Exception/Exception.php', + 'PHPUnit_Framework_MockObject_Generator' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Generator.php', + 'PHPUnit_Framework_MockObject_Invocation' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Invocation.php', + 'PHPUnit_Framework_MockObject_InvocationMocker' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/InvocationMocker.php', + 'PHPUnit_Framework_MockObject_Invocation_Object' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Invocation/Object.php', + 'PHPUnit_Framework_MockObject_Invocation_Static' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Invocation/Static.php', + 'PHPUnit_Framework_MockObject_Invokable' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Invokable.php', + 'PHPUnit_Framework_MockObject_Matcher' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher.php', + 'PHPUnit_Framework_MockObject_Matcher_AnyInvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/AnyInvokedCount.php', + 'PHPUnit_Framework_MockObject_Matcher_AnyParameters' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/AnyParameters.php', + 'PHPUnit_Framework_MockObject_Matcher_ConsecutiveParameters' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/ConsecutiveParameters.php', + 'PHPUnit_Framework_MockObject_Matcher_Invocation' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/Invocation.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedAtIndex' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtIndex.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastCount' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtLeastCount.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedAtLeastOnce' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtLeastOnce.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedAtMostCount' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedAtMostCount.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedCount' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedCount.php', + 'PHPUnit_Framework_MockObject_Matcher_InvokedRecorder' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/InvokedRecorder.php', + 'PHPUnit_Framework_MockObject_Matcher_MethodName' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/MethodName.php', + 'PHPUnit_Framework_MockObject_Matcher_Parameters' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/Parameters.php', + 'PHPUnit_Framework_MockObject_Matcher_StatelessInvocation' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Matcher/StatelessInvocation.php', + 'PHPUnit_Framework_MockObject_MockBuilder' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/MockBuilder.php', + 'PHPUnit_Framework_MockObject_MockObject' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/MockObject.php', + 'PHPUnit_Framework_MockObject_RuntimeException' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Exception/RuntimeException.php', + 'PHPUnit_Framework_MockObject_Stub' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub.php', + 'PHPUnit_Framework_MockObject_Stub_ConsecutiveCalls' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ConsecutiveCalls.php', + 'PHPUnit_Framework_MockObject_Stub_Exception' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/Exception.php', + 'PHPUnit_Framework_MockObject_Stub_MatcherCollection' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/MatcherCollection.php', + 'PHPUnit_Framework_MockObject_Stub_Return' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/Return.php', + 'PHPUnit_Framework_MockObject_Stub_ReturnArgument' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnArgument.php', + 'PHPUnit_Framework_MockObject_Stub_ReturnCallback' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnCallback.php', + 'PHPUnit_Framework_MockObject_Stub_ReturnSelf' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnSelf.php', + 'PHPUnit_Framework_MockObject_Stub_ReturnValueMap' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Stub/ReturnValueMap.php', + 'PHPUnit_Framework_MockObject_Verifiable' => __DIR__ . '/..' . '/phpunit/phpunit-mock-objects/src/Framework/MockObject/Verifiable.php', + 'PHPUnit_Framework_OutputError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/OutputError.php', + 'PHPUnit_Framework_RiskyTest' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/RiskyTest.php', + 'PHPUnit_Framework_RiskyTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/RiskyTestError.php', + 'PHPUnit_Framework_SelfDescribing' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SelfDescribing.php', + 'PHPUnit_Framework_SkippedTest' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SkippedTest.php', + 'PHPUnit_Framework_SkippedTestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SkippedTestCase.php', + 'PHPUnit_Framework_SkippedTestError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SkippedTestError.php', + 'PHPUnit_Framework_SkippedTestSuiteError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SkippedTestSuiteError.php', + 'PHPUnit_Framework_SyntheticError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/SyntheticError.php', + 'PHPUnit_Framework_Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Test.php', + 'PHPUnit_Framework_TestCase' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestCase.php', + 'PHPUnit_Framework_TestFailure' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestFailure.php', + 'PHPUnit_Framework_TestListener' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestListener.php', + 'PHPUnit_Framework_TestResult' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestResult.php', + 'PHPUnit_Framework_TestSuite' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestSuite.php', + 'PHPUnit_Framework_TestSuite_DataProvider' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/TestSuite/DataProvider.php', + 'PHPUnit_Framework_UnintentionallyCoveredCodeError' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/UnintentionallyCoveredCodeError.php', + 'PHPUnit_Framework_Warning' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/Warning.php', + 'PHPUnit_Runner_BaseTestRunner' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/BaseTestRunner.php', + 'PHPUnit_Runner_Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception.php', + 'PHPUnit_Runner_Filter_Factory' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/Factory.php', + 'PHPUnit_Runner_Filter_GroupFilterIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/Group.php', + 'PHPUnit_Runner_Filter_Group_Exclude' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/Group/Exclude.php', + 'PHPUnit_Runner_Filter_Group_Include' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/Group/Include.php', + 'PHPUnit_Runner_Filter_Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Filter/Test.php', + 'PHPUnit_Runner_StandardTestSuiteLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/StandardTestSuiteLoader.php', + 'PHPUnit_Runner_TestSuiteLoader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestSuiteLoader.php', + 'PHPUnit_Runner_Version' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Version.php', + 'PHPUnit_TextUI_Command' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Command.php', + 'PHPUnit_TextUI_ResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/ResultPrinter.php', + 'PHPUnit_TextUI_TestRunner' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/TestRunner.php', + 'PHPUnit_Util_Blacklist' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Blacklist.php', + 'PHPUnit_Util_Configuration' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Configuration.php', + 'PHPUnit_Util_ErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/ErrorHandler.php', + 'PHPUnit_Util_Fileloader' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Fileloader.php', + 'PHPUnit_Util_Filesystem' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filesystem.php', + 'PHPUnit_Util_Filter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Filter.php', + 'PHPUnit_Util_Getopt' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Getopt.php', + 'PHPUnit_Util_GlobalState' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/GlobalState.php', + 'PHPUnit_Util_InvalidArgumentHelper' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/InvalidArgumentHelper.php', + 'PHPUnit_Util_Log_JSON' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Log/JSON.php', + 'PHPUnit_Util_Log_JUnit' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Log/JUnit.php', + 'PHPUnit_Util_Log_TAP' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Log/TAP.php', + 'PHPUnit_Util_PHP' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP.php', + 'PHPUnit_Util_PHP_Default' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/Default.php', + 'PHPUnit_Util_PHP_Windows' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/PHP/Windows.php', + 'PHPUnit_Util_Printer' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Printer.php', + 'PHPUnit_Util_Regex' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Regex.php', + 'PHPUnit_Util_String' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/String.php', + 'PHPUnit_Util_Test' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Test.php', + 'PHPUnit_Util_TestDox_NamePrettifier' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/NamePrettifier.php', + 'PHPUnit_Util_TestDox_ResultPrinter' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter.php', + 'PHPUnit_Util_TestDox_ResultPrinter_HTML' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter/HTML.php', + 'PHPUnit_Util_TestDox_ResultPrinter_Text' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestDox/ResultPrinter/Text.php', + 'PHPUnit_Util_TestSuiteIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/TestSuiteIterator.php', + 'PHPUnit_Util_Type' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/Type.php', + 'PHPUnit_Util_XML' => __DIR__ . '/..' . '/phpunit/phpunit/src/Util/XML.php', + 'PHP_CodeCoverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage.php', + 'PHP_CodeCoverage_Driver' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Driver.php', + 'PHP_CodeCoverage_Driver_HHVM' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Driver/HHVM.php', + 'PHP_CodeCoverage_Driver_PHPDBG' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Driver/PHPDBG.php', + 'PHP_CodeCoverage_Driver_Xdebug' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Driver/Xdebug.php', + 'PHP_CodeCoverage_Exception' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Exception.php', + 'PHP_CodeCoverage_Exception_UnintentionallyCoveredCode' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Exception/UnintentionallyCoveredCode.php', + 'PHP_CodeCoverage_Filter' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Filter.php', + 'PHP_CodeCoverage_Report_Clover' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Clover.php', + 'PHP_CodeCoverage_Report_Crap4j' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Crap4j.php', + 'PHP_CodeCoverage_Report_Factory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Factory.php', + 'PHP_CodeCoverage_Report_HTML' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML.php', + 'PHP_CodeCoverage_Report_HTML_Renderer' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer.php', + 'PHP_CodeCoverage_Report_HTML_Renderer_Dashboard' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Dashboard.php', + 'PHP_CodeCoverage_Report_HTML_Renderer_Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/Directory.php', + 'PHP_CodeCoverage_Report_HTML_Renderer_File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php', + 'PHP_CodeCoverage_Report_Node' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Node.php', + 'PHP_CodeCoverage_Report_Node_Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/Directory.php', + 'PHP_CodeCoverage_Report_Node_File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/File.php', + 'PHP_CodeCoverage_Report_Node_Iterator' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Node/Iterator.php', + 'PHP_CodeCoverage_Report_PHP' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/PHP.php', + 'PHP_CodeCoverage_Report_Text' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/Text.php', + 'PHP_CodeCoverage_Report_XML' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML.php', + 'PHP_CodeCoverage_Report_XML_Directory' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Directory.php', + 'PHP_CodeCoverage_Report_XML_File' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File.php', + 'PHP_CodeCoverage_Report_XML_File_Coverage' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File/Coverage.php', + 'PHP_CodeCoverage_Report_XML_File_Method' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File/Method.php', + 'PHP_CodeCoverage_Report_XML_File_Report' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File/Report.php', + 'PHP_CodeCoverage_Report_XML_File_Unit' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/File/Unit.php', + 'PHP_CodeCoverage_Report_XML_Node' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Node.php', + 'PHP_CodeCoverage_Report_XML_Project' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Project.php', + 'PHP_CodeCoverage_Report_XML_Tests' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Tests.php', + 'PHP_CodeCoverage_Report_XML_Totals' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Report/XML/Totals.php', + 'PHP_CodeCoverage_Util' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Util.php', + 'PHP_CodeCoverage_Util_InvalidArgumentHelper' => __DIR__ . '/..' . '/phpunit/php-code-coverage/src/CodeCoverage/Util/InvalidArgumentHelper.php', + 'PHP_CodeSniffer' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer.php', + 'PHP_CodeSniffer_CLI' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/CLI.php', + 'PHP_CodeSniffer_DocGenerators_Generator' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/DocGenerators/Generator.php', + 'PHP_CodeSniffer_DocGenerators_HTML' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/DocGenerators/HTML.php', + 'PHP_CodeSniffer_DocGenerators_Markdown' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/DocGenerators/Markdown.php', + 'PHP_CodeSniffer_DocGenerators_Text' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/DocGenerators/Text.php', + 'PHP_CodeSniffer_Exception' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Exception.php', + 'PHP_CodeSniffer_File' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/File.php', + 'PHP_CodeSniffer_Fixer' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Fixer.php', + 'PHP_CodeSniffer_Report' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Report.php', + 'PHP_CodeSniffer_Reporting' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reporting.php', + 'PHP_CodeSniffer_Reports_Cbf' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Cbf.php', + 'PHP_CodeSniffer_Reports_Checkstyle' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Checkstyle.php', + 'PHP_CodeSniffer_Reports_Csv' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Csv.php', + 'PHP_CodeSniffer_Reports_Diff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Diff.php', + 'PHP_CodeSniffer_Reports_Emacs' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Emacs.php', + 'PHP_CodeSniffer_Reports_Full' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Full.php', + 'PHP_CodeSniffer_Reports_Gitblame' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Gitblame.php', + 'PHP_CodeSniffer_Reports_Hgblame' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Hgblame.php', + 'PHP_CodeSniffer_Reports_Info' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Info.php', + 'PHP_CodeSniffer_Reports_Json' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Json.php', + 'PHP_CodeSniffer_Reports_Junit' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Junit.php', + 'PHP_CodeSniffer_Reports_Notifysend' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Notifysend.php', + 'PHP_CodeSniffer_Reports_Source' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Source.php', + 'PHP_CodeSniffer_Reports_Summary' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Summary.php', + 'PHP_CodeSniffer_Reports_Svnblame' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Svnblame.php', + 'PHP_CodeSniffer_Reports_VersionControl' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/VersionControl.php', + 'PHP_CodeSniffer_Reports_Xml' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Reports/Xml.php', + 'PHP_CodeSniffer_Sniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Sniff.php', + 'PHP_CodeSniffer_Standards_AbstractPatternSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/AbstractPatternSniff.php', + 'PHP_CodeSniffer_Standards_AbstractScopeSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/AbstractScopeSniff.php', + 'PHP_CodeSniffer_Standards_AbstractVariableSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/AbstractVariableSniff.php', + 'PHP_CodeSniffer_Standards_IncorrectPatternException' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/IncorrectPatternException.php', + 'PHP_CodeSniffer_Tokenizers_CSS' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/CSS.php', + 'PHP_CodeSniffer_Tokenizers_Comment' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/Comment.php', + 'PHP_CodeSniffer_Tokenizers_JS' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/JS.php', + 'PHP_CodeSniffer_Tokenizers_PHP' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/PHP.php', + 'PHP_CodeSniffer_Tokens' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Tokens.php', + 'PHP_Timer' => __DIR__ . '/..' . '/phpunit/php-timer/src/Timer.php', + 'PHP_Token' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_TokenWithScope' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_TokenWithScopeAndVisibility' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ABSTRACT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_AMPERSAND' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_AND_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ARRAY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ARRAY_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_AS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ASYNC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_AT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_AWAIT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_BACKTICK' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_BAD_CHARACTER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_BOOLEAN_AND' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_BOOLEAN_OR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_BOOL_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_BREAK' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CALLABLE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CARET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CASE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CATCH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CHARACTER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CLASS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CLASS_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CLASS_NAME_CONSTANT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CLONE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CLOSE_BRACKET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CLOSE_CURLY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CLOSE_SQUARE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CLOSE_TAG' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_COALESCE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_COLON' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_COMMA' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_COMMENT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_COMPILER_HALT_OFFSET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CONCAT_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CONST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CONSTANT_ENCAPSED_STRING' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CONTINUE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_CURLY_OPEN' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DEC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DECLARE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DEFAULT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DIR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DIV' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DIV_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DNUMBER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DO' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DOC_COMMENT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DOLLAR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DOLLAR_OPEN_CURLY_BRACES' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DOT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DOUBLE_ARROW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DOUBLE_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DOUBLE_COLON' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_DOUBLE_QUOTES' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ECHO' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ELLIPSIS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ELSE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ELSEIF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_EMPTY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ENCAPSED_AND_WHITESPACE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ENDDECLARE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ENDFOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ENDFOREACH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ENDIF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ENDSWITCH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ENDWHILE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_END_HEREDOC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ENUM' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_EQUALS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_EVAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_EXCLAMATION_MARK' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_EXIT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_EXTENDS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_FILE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_FINAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_FINALLY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_FOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_FOREACH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_FUNCTION' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_FUNC_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_GLOBAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_GOTO' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_GT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_HALT_COMPILER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IMPLEMENTS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IN' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_INC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_INCLUDE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_INCLUDE_ONCE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_INLINE_HTML' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_INSTANCEOF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_INSTEADOF' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_INTERFACE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_INT_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ISSET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IS_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IS_GREATER_OR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IS_IDENTICAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IS_NOT_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IS_NOT_IDENTICAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_IS_SMALLER_OR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_Includes' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_JOIN' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LAMBDA_ARROW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LAMBDA_CP' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LAMBDA_OP' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LINE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LIST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LNUMBER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LOGICAL_AND' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LOGICAL_OR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LOGICAL_XOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_LT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_METHOD_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_MINUS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_MINUS_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_MOD_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_MULT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_MUL_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_NAMESPACE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_NEW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_NS_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_NS_SEPARATOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_NUM_STRING' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_OBJECT_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_OBJECT_OPERATOR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_ONUMBER' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_OPEN_BRACKET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_OPEN_CURLY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_OPEN_SQUARE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_OPEN_TAG' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_OPEN_TAG_WITH_ECHO' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_OR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PAAMAYIM_NEKUDOTAYIM' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PERCENT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PIPE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PLUS' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PLUS_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_POW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_POW_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PRINT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PRIVATE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PROTECTED' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_PUBLIC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_QUESTION_MARK' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_REQUIRE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_REQUIRE_ONCE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_RETURN' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SEMICOLON' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SHAPE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SL_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SPACESHIP' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_START_HEREDOC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_STATIC' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_STRING' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_STRING_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_STRING_VARNAME' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_SWITCH' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_Stream' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token/Stream.php', + 'PHP_Token_Stream_CachingFactory' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token/Stream/CachingFactory.php', + 'PHP_Token_THROW' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_TILDE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_TRAIT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_TRAIT_C' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_TRY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_TYPE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_TYPELIST_GT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_TYPELIST_LT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_UNSET' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_UNSET_CAST' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_USE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_VAR' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_VARIABLE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_WHERE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_WHILE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_WHITESPACE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_ATTRIBUTE' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_CATEGORY' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_CATEGORY_LABEL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_CHILDREN' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_LABEL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_REQUIRED' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_TAG_GT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_TAG_LT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XHP_TEXT' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_XOR_EQUAL' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_YIELD' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PHP_Token_YIELD_FROM' => __DIR__ . '/..' . '/phpunit/php-token-stream/src/Token.php', + 'PSR1_Sniffs_Classes_ClassDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR1/Sniffs/Classes/ClassDeclarationSniff.php', + 'PSR1_Sniffs_Files_SideEffectsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php', + 'PSR1_Sniffs_Methods_CamelCapsMethodNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR1/Sniffs/Methods/CamelCapsMethodNameSniff.php', + 'PSR2_Sniffs_Classes_ClassDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php', + 'PSR2_Sniffs_Classes_PropertyDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php', + 'PSR2_Sniffs_ControlStructures_ControlStructureSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/ControlStructureSpacingSniff.php', + 'PSR2_Sniffs_ControlStructures_ElseIfDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/ElseIfDeclarationSniff.php', + 'PSR2_Sniffs_ControlStructures_SwitchDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php', + 'PSR2_Sniffs_Files_ClosingTagSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Files/ClosingTagSniff.php', + 'PSR2_Sniffs_Files_EndFileNewlineSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Files/EndFileNewlineSniff.php', + 'PSR2_Sniffs_Methods_FunctionCallSignatureSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/FunctionCallSignatureSniff.php', + 'PSR2_Sniffs_Methods_FunctionClosingBraceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php', + 'PSR2_Sniffs_Methods_MethodDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/MethodDeclarationSniff.php', + 'PSR2_Sniffs_Namespaces_NamespaceDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php', + 'PSR2_Sniffs_Namespaces_UseDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Namespaces/UseDeclarationSniff.php', + 'SebastianBergmann\\Comparator\\ArrayComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ArrayComparator.php', + 'SebastianBergmann\\Comparator\\Comparator' => __DIR__ . '/..' . '/sebastian/comparator/src/Comparator.php', + 'SebastianBergmann\\Comparator\\ComparisonFailure' => __DIR__ . '/..' . '/sebastian/comparator/src/ComparisonFailure.php', + 'SebastianBergmann\\Comparator\\DOMNodeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DOMNodeComparator.php', + 'SebastianBergmann\\Comparator\\DateTimeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DateTimeComparator.php', + 'SebastianBergmann\\Comparator\\DoubleComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/DoubleComparator.php', + 'SebastianBergmann\\Comparator\\ExceptionComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ExceptionComparator.php', + 'SebastianBergmann\\Comparator\\Factory' => __DIR__ . '/..' . '/sebastian/comparator/src/Factory.php', + 'SebastianBergmann\\Comparator\\MockObjectComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/MockObjectComparator.php', + 'SebastianBergmann\\Comparator\\NumericComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/NumericComparator.php', + 'SebastianBergmann\\Comparator\\ObjectComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ObjectComparator.php', + 'SebastianBergmann\\Comparator\\ResourceComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ResourceComparator.php', + 'SebastianBergmann\\Comparator\\ScalarComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/ScalarComparator.php', + 'SebastianBergmann\\Comparator\\SplObjectStorageComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/SplObjectStorageComparator.php', + 'SebastianBergmann\\Comparator\\TypeComparator' => __DIR__ . '/..' . '/sebastian/comparator/src/TypeComparator.php', + 'SebastianBergmann\\Diff\\Chunk' => __DIR__ . '/..' . '/sebastian/diff/src/Chunk.php', + 'SebastianBergmann\\Diff\\Diff' => __DIR__ . '/..' . '/sebastian/diff/src/Diff.php', + 'SebastianBergmann\\Diff\\Differ' => __DIR__ . '/..' . '/sebastian/diff/src/Differ.php', + 'SebastianBergmann\\Diff\\LCS\\LongestCommonSubsequence' => __DIR__ . '/..' . '/sebastian/diff/src/LCS/LongestCommonSubsequence.php', + 'SebastianBergmann\\Diff\\LCS\\MemoryEfficientImplementation' => __DIR__ . '/..' . '/sebastian/diff/src/LCS/MemoryEfficientLongestCommonSubsequenceImplementation.php', + 'SebastianBergmann\\Diff\\LCS\\TimeEfficientImplementation' => __DIR__ . '/..' . '/sebastian/diff/src/LCS/TimeEfficientLongestCommonSubsequenceImplementation.php', + 'SebastianBergmann\\Diff\\Line' => __DIR__ . '/..' . '/sebastian/diff/src/Line.php', + 'SebastianBergmann\\Diff\\Parser' => __DIR__ . '/..' . '/sebastian/diff/src/Parser.php', + 'SebastianBergmann\\Environment\\Console' => __DIR__ . '/..' . '/sebastian/environment/src/Console.php', + 'SebastianBergmann\\Environment\\Runtime' => __DIR__ . '/..' . '/sebastian/environment/src/Runtime.php', + 'SebastianBergmann\\Exporter\\Exporter' => __DIR__ . '/..' . '/sebastian/exporter/src/Exporter.php', + 'SebastianBergmann\\GlobalState\\Blacklist' => __DIR__ . '/..' . '/sebastian/global-state/src/Blacklist.php', + 'SebastianBergmann\\GlobalState\\CodeExporter' => __DIR__ . '/..' . '/sebastian/global-state/src/CodeExporter.php', + 'SebastianBergmann\\GlobalState\\Exception' => __DIR__ . '/..' . '/sebastian/global-state/src/Exception.php', + 'SebastianBergmann\\GlobalState\\Restorer' => __DIR__ . '/..' . '/sebastian/global-state/src/Restorer.php', + 'SebastianBergmann\\GlobalState\\RuntimeException' => __DIR__ . '/..' . '/sebastian/global-state/src/RuntimeException.php', + 'SebastianBergmann\\GlobalState\\Snapshot' => __DIR__ . '/..' . '/sebastian/global-state/src/Snapshot.php', + 'SebastianBergmann\\RecursionContext\\Context' => __DIR__ . '/..' . '/sebastian/recursion-context/src/Context.php', + 'SebastianBergmann\\RecursionContext\\Exception' => __DIR__ . '/..' . '/sebastian/recursion-context/src/Exception.php', + 'SebastianBergmann\\RecursionContext\\InvalidArgumentException' => __DIR__ . '/..' . '/sebastian/recursion-context/src/InvalidArgumentException.php', + 'SebastianBergmann\\Version' => __DIR__ . '/..' . '/sebastian/version/src/Version.php', + 'Squiz_Sniffs_Arrays_ArrayBracketSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php', + 'Squiz_Sniffs_Arrays_ArrayDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php', + 'Squiz_Sniffs_CSS_ClassDefinitionClosingBraceSpaceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionClosingBraceSpaceSniff.php', + 'Squiz_Sniffs_CSS_ClassDefinitionNameSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php', + 'Squiz_Sniffs_CSS_ClassDefinitionOpeningBraceSpaceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php', + 'Squiz_Sniffs_CSS_ColonSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ColonSpacingSniff.php', + 'Squiz_Sniffs_CSS_ColourDefinitionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php', + 'Squiz_Sniffs_CSS_DisallowMultipleStyleDefinitionsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/DisallowMultipleStyleDefinitionsSniff.php', + 'Squiz_Sniffs_CSS_DuplicateClassDefinitionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/DuplicateClassDefinitionSniff.php', + 'Squiz_Sniffs_CSS_DuplicateStyleDefinitionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/DuplicateStyleDefinitionSniff.php', + 'Squiz_Sniffs_CSS_EmptyClassDefinitionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/EmptyClassDefinitionSniff.php', + 'Squiz_Sniffs_CSS_EmptyStyleDefinitionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/EmptyStyleDefinitionSniff.php', + 'Squiz_Sniffs_CSS_ForbiddenStylesSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ForbiddenStylesSniff.php', + 'Squiz_Sniffs_CSS_IndentationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/IndentationSniff.php', + 'Squiz_Sniffs_CSS_LowercaseStyleDefinitionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/LowercaseStyleDefinitionSniff.php', + 'Squiz_Sniffs_CSS_MissingColonSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/MissingColonSniff.php', + 'Squiz_Sniffs_CSS_NamedColoursSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/NamedColoursSniff.php', + 'Squiz_Sniffs_CSS_OpacitySniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/OpacitySniff.php', + 'Squiz_Sniffs_CSS_SemicolonSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/SemicolonSpacingSniff.php', + 'Squiz_Sniffs_CSS_ShorthandSizeSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ShorthandSizeSniff.php', + 'Squiz_Sniffs_Classes_ClassDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php', + 'Squiz_Sniffs_Classes_ClassFileNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Classes/ClassFileNameSniff.php', + 'Squiz_Sniffs_Classes_DuplicatePropertySniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Classes/DuplicatePropertySniff.php', + 'Squiz_Sniffs_Classes_LowercaseClassKeywordsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Classes/LowercaseClassKeywordsSniff.php', + 'Squiz_Sniffs_Classes_SelfMemberReferenceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Classes/SelfMemberReferenceSniff.php', + 'Squiz_Sniffs_Classes_ValidClassNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Classes/ValidClassNameSniff.php', + 'Squiz_Sniffs_Commenting_BlockCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php', + 'Squiz_Sniffs_Commenting_ClassCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php', + 'Squiz_Sniffs_Commenting_ClosingDeclarationCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClosingDeclarationCommentSniff.php', + 'Squiz_Sniffs_Commenting_DocCommentAlignmentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php', + 'Squiz_Sniffs_Commenting_EmptyCatchCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/EmptyCatchCommentSniff.php', + 'Squiz_Sniffs_Commenting_FileCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php', + 'Squiz_Sniffs_Commenting_FunctionCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php', + 'Squiz_Sniffs_Commenting_FunctionCommentThrowTagSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php', + 'Squiz_Sniffs_Commenting_InlineCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php', + 'Squiz_Sniffs_Commenting_LongConditionClosingCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/LongConditionClosingCommentSniff.php', + 'Squiz_Sniffs_Commenting_PostStatementCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/PostStatementCommentSniff.php', + 'Squiz_Sniffs_Commenting_VariableCommentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php', + 'Squiz_Sniffs_ControlStructures_ControlSignatureSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ControlSignatureSniff.php', + 'Squiz_Sniffs_ControlStructures_ElseIfDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ElseIfDeclarationSniff.php', + 'Squiz_Sniffs_ControlStructures_ForEachLoopDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ForEachLoopDeclarationSniff.php', + 'Squiz_Sniffs_ControlStructures_ForLoopDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/ForLoopDeclarationSniff.php', + 'Squiz_Sniffs_ControlStructures_InlineIfDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php', + 'Squiz_Sniffs_ControlStructures_LowercaseDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/LowercaseDeclarationSniff.php', + 'Squiz_Sniffs_ControlStructures_SwitchDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/SwitchDeclarationSniff.php', + 'Squiz_Sniffs_Debug_JSLintSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Debug/JSLintSniff.php', + 'Squiz_Sniffs_Debug_JavaScriptLintSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Debug/JavaScriptLintSniff.php', + 'Squiz_Sniffs_Files_FileExtensionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Files/FileExtensionSniff.php', + 'Squiz_Sniffs_Formatting_OperatorBracketSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Formatting/OperatorBracketSniff.php', + 'Squiz_Sniffs_Functions_FunctionDeclarationArgumentSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php', + 'Squiz_Sniffs_Functions_FunctionDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationSniff.php', + 'Squiz_Sniffs_Functions_FunctionDuplicateArgumentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDuplicateArgumentSniff.php', + 'Squiz_Sniffs_Functions_GlobalFunctionSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/GlobalFunctionSniff.php', + 'Squiz_Sniffs_Functions_LowercaseFunctionKeywordsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/LowercaseFunctionKeywordsSniff.php', + 'Squiz_Sniffs_Functions_MultiLineFunctionDeclarationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php', + 'Squiz_Sniffs_NamingConventions_ValidFunctionNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/NamingConventions/ValidFunctionNameSniff.php', + 'Squiz_Sniffs_NamingConventions_ValidVariableNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/NamingConventions/ValidVariableNameSniff.php', + 'Squiz_Sniffs_Objects_DisallowObjectStringIndexSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Objects/DisallowObjectStringIndexSniff.php', + 'Squiz_Sniffs_Objects_ObjectInstantiationSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Objects/ObjectInstantiationSniff.php', + 'Squiz_Sniffs_Objects_ObjectMemberCommaSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Objects/ObjectMemberCommaSniff.php', + 'Squiz_Sniffs_Operators_ComparisonOperatorUsageSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php', + 'Squiz_Sniffs_Operators_IncrementDecrementUsageSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/IncrementDecrementUsageSniff.php', + 'Squiz_Sniffs_Operators_ValidLogicalOperatorsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/ValidLogicalOperatorsSniff.php', + 'Squiz_Sniffs_PHP_CommentedOutCodeSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php', + 'Squiz_Sniffs_PHP_DisallowBooleanStatementSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowBooleanStatementSniff.php', + 'Squiz_Sniffs_PHP_DisallowComparisonAssignmentSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowComparisonAssignmentSniff.php', + 'Squiz_Sniffs_PHP_DisallowInlineIfSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowInlineIfSniff.php', + 'Squiz_Sniffs_PHP_DisallowMultipleAssignmentsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowMultipleAssignmentsSniff.php', + 'Squiz_Sniffs_PHP_DisallowObEndFlushSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowObEndFlushSniff.php', + 'Squiz_Sniffs_PHP_DisallowSizeFunctionsInLoopsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DisallowSizeFunctionsInLoopsSniff.php', + 'Squiz_Sniffs_PHP_DiscouragedFunctionsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/DiscouragedFunctionsSniff.php', + 'Squiz_Sniffs_PHP_EmbeddedPhpSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/EmbeddedPhpSniff.php', + 'Squiz_Sniffs_PHP_EvalSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/EvalSniff.php', + 'Squiz_Sniffs_PHP_ForbiddenFunctionsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/ForbiddenFunctionsSniff.php', + 'Squiz_Sniffs_PHP_GlobalKeywordSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/GlobalKeywordSniff.php', + 'Squiz_Sniffs_PHP_HeredocSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/HeredocSniff.php', + 'Squiz_Sniffs_PHP_InnerFunctionsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php', + 'Squiz_Sniffs_PHP_LowercasePHPFunctionsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php', + 'Squiz_Sniffs_PHP_NonExecutableCodeSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php', + 'Squiz_Sniffs_Scope_MemberVarScopeSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php', + 'Squiz_Sniffs_Scope_MethodScopeSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Scope/MethodScopeSniff.php', + 'Squiz_Sniffs_Scope_StaticThisUsageSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Scope/StaticThisUsageSniff.php', + 'Squiz_Sniffs_Strings_ConcatenationSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Strings/ConcatenationSpacingSniff.php', + 'Squiz_Sniffs_Strings_DoubleQuoteUsageSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Strings/DoubleQuoteUsageSniff.php', + 'Squiz_Sniffs_Strings_EchoedStringsSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Strings/EchoedStringsSniff.php', + 'Squiz_Sniffs_WhiteSpace_CastSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/CastSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_ControlStructureSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_FunctionClosingBraceSpaceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/FunctionClosingBraceSpaceSniff.php', + 'Squiz_Sniffs_WhiteSpace_FunctionOpeningBraceSpaceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/FunctionOpeningBraceSpaceSniff.php', + 'Squiz_Sniffs_WhiteSpace_FunctionSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/FunctionSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_LanguageConstructSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/LanguageConstructSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_LogicalOperatorSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/LogicalOperatorSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_MemberVarSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_ObjectOperatorSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ObjectOperatorSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_OperatorSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_PropertyLabelSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/PropertyLabelSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_ScopeClosingBraceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeClosingBraceSniff.php', + 'Squiz_Sniffs_WhiteSpace_ScopeKeywordSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_SemicolonSpacingSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/SemicolonSpacingSniff.php', + 'Squiz_Sniffs_WhiteSpace_SuperfluousWhitespaceSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/SuperfluousWhitespaceSniff.php', + 'Text_Template' => __DIR__ . '/..' . '/phpunit/php-text-template/src/Template.php', + 'Zend_Sniffs_Debug_CodeAnalyzerSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Zend/Sniffs/Debug/CodeAnalyzerSniff.php', + 'Zend_Sniffs_Files_ClosingTagSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Zend/Sniffs/Files/ClosingTagSniff.php', + 'Zend_Sniffs_NamingConventions_ValidVariableNameSniff' => __DIR__ . '/..' . '/squizlabs/php_codesniffer/CodeSniffer/Standards/Zend/Sniffs/NamingConventions/ValidVariableNameSniff.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInitb3afba8d614ff1f43cdd7aeb18613292::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInitb3afba8d614ff1f43cdd7aeb18613292::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInitb3afba8d614ff1f43cdd7aeb18613292::$prefixesPsr0; + $loader->classMap = ComposerStaticInitb3afba8d614ff1f43cdd7aeb18613292::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 1c200ae4..d9367fe2 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -104,66 +104,6 @@ ], "description": "Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function." }, - { - "name": "guzzlehttp/guzzle", - "version": "5.3.0", - "version_normalized": "5.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "f3c8c22471cb55475105c14769644a49c3262b93" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f3c8c22471cb55475105c14769644a49c3262b93", - "reference": "f3c8c22471cb55475105c14769644a49c3262b93", - "shasum": "" - }, - "require": { - "guzzlehttp/ringphp": "^1.1", - "php": ">=5.4.0" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.0", - "psr/log": "^1.0" - }, - "time": "2015-05-20 03:47:55", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ] - }, { "name": "sebastian/version", "version": "1.0.6", @@ -309,74 +249,6 @@ "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context" }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "time": "2015-06-21 07:55:53", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ] - }, { "name": "sebastian/diff", "version": "1.4.1", @@ -553,121 +425,6 @@ "instantiate" ] }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "version_normalized": "2.0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "time": "2015-02-03 12:10:50", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ] - }, - { - "name": "phpspec/prophecy", - "version": "v1.6.0", - "version_normalized": "1.6.0.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", - "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpspec/phpspec": "~2.0" - }, - "time": "2016-02-15 07:46:21", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.5.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "Prophecy\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ] - }, { "name": "phpunit/php-text-template", "version": "1.2.1", @@ -769,49 +526,6 @@ "xunit" ] }, - { - "name": "phpunit/php-timer", - "version": "1.0.7", - "version_normalized": "1.0.7.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "reference": "3e82f4e9fc92665fafd9157568e4dcb01d014e5b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "time": "2015-06-21 08:01:12", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ] - }, { "name": "phpunit/php-token-stream", "version": "1.4.8", @@ -977,90 +691,545 @@ ] }, { - "name": "sebastian/environment", - "version": "1.3.5", - "version_normalized": "1.3.5.0", + "name": "psr/log", + "version": "1.0.0", + "version_normalized": "1.0.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf" + "url": "https://github.com/php-fig/log.git", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf", - "shasum": "" + "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", + "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "shasum": "" + }, + "time": "2012-12-21 11:40:51", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "Psr\\Log\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "keywords": [ + "log", + "psr", + "psr-3" + ] + }, + { + "name": "react/promise", + "version": "v2.4.1", + "version_normalized": "2.4.1.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "8025426794f1944de806618671d4fa476dc7626f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8025426794f1944de806618671d4fa476dc7626f", + "reference": "8025426794f1944de806618671d4fa476dc7626f", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "time": "2016-05-03 17:50:52", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "React\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP" + }, + { + "name": "guzzlehttp/guzzle", + "version": "5.3.1", + "version_normalized": "5.3.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "70f1fa53b71c4647bf2762c09068a95f77e12fb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/70f1fa53b71c4647bf2762c09068a95f77e12fb8", + "reference": "70f1fa53b71c4647bf2762c09068a95f77e12fb8", + "shasum": "" + }, + "require": { + "guzzlehttp/ringphp": "^1.1", + "php": ">=5.4.0" + }, + "require-dev": { + "ext-curl": "*", + "phpunit/phpunit": "^4.0" + }, + "time": "2016-07-15 19:28:39", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library and framework for building RESTful web service clients", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ] + }, + { + "name": "cloudflare/cloudflare-plugin-backend", + "version": "1.1.0", + "version_normalized": "1.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/cloudflare/cloudflare-plugin-backend.git", + "reference": "1c81bb1f86650d8e0a121a14633fa8a94ef1496c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cloudflare/cloudflare-plugin-backend/zipball/1c81bb1f86650d8e0a121a14633fa8a94ef1496c", + "reference": "1c81bb1f86650d8e0a121a14633fa8a94ef1496c", + "shasum": "" + }, + "require": { + "guzzlehttp/guzzle": "~5.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "4.8.*", + "squizlabs/php_codesniffer": "2.*" + }, + "time": "2016-08-11 23:24:15", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "CF\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "A PHP backend for CloudFlare plugins." + }, + { + "name": "symfony/yaml", + "version": "v2.8.9", + "version_normalized": "2.8.9.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/0ceab136f43ed9d3e97b3eea32a7855dc50c121d", + "reference": "0ceab136f43ed9d3e97b3eea32a7855dc50c121d", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "time": "2016-07-17 09:06:15", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "version_normalized": "1.2.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "time": "2016-06-17 09:04:28", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ] + }, + { + "name": "sebastian/environment", + "version": "1.3.7", + "version_normalized": "1.3.7.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", + "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "time": "2016-05-17 03:18:57", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ] + }, + { + "name": "phpunit/php-timer", + "version": "1.0.8", + "version_normalized": "1.0.8.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/38e9124049cf1a164f1e4537caf19c99bf1eb260", + "reference": "38e9124049cf1a164f1e4537caf19c99bf1eb260", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, + "time": "2016-05-12 18:03:57", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ] + }, + { + "name": "webmozart/assert", + "version": "1.1.0", + "version_normalized": "1.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "time": "2016-08-09 15:02:57", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ] + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "reference": "144c307535e82c8fdcaacbcfc1d6d8eeb896687c", + "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.5" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.6" }, - "time": "2016-02-26 18:40:46", + "time": "2015-12-27 11:43:31", "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" } ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", "keywords": [ - "Xdebug", - "environment", - "hhvm" + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" ] }, { - "name": "symfony/yaml", - "version": "v2.8.3", - "version_normalized": "2.8.3.0", + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "version_normalized": "0.2.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "2a4ee40acb880c56f29fb1b8886e7ffe94f3b995" + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/2a4ee40acb880c56f29fb1b8886e7ffe94f3b995", - "reference": "2a4ee40acb880c56f29fb1b8886e7ffe94f3b995", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" }, - "time": "2016-02-23 07:41:20", + "time": "2016-06-10 07:14:17", "type": "library", "extra": { "branch-alias": { - "dev-master": "2.8-dev" + "dev-master": "1.0.x-dev" } }, "installation-source": "dist", "autoload": { "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1068,30 +1237,135 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ] + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.1.0", + "version_normalized": "3.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/9270140b940ff02e58ec577c237274e92cd40cdd", + "reference": "9270140b940ff02e58ec577c237274e92cd40cdd", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "time": "2016-06-10 09:48:41", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock." + }, + { + "name": "phpspec/prophecy", + "version": "v1.6.1", + "version_normalized": "1.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/58a8137754bc24b25740d4281399a4a3596058e0", + "reference": "58a8137754bc24b25740d4281399a4a3596058e0", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", + "sebastian/recursion-context": "^1.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.0" + }, + "time": "2016-06-07 08:13:47", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.6.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" } ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com" + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ] }, { "name": "phpunit/phpunit", - "version": "4.8.24", - "version_normalized": "4.8.24.0", + "version": "4.8.27", + "version_normalized": "4.8.27.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e" + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a1066c562c52900a142a0e2bbf0582994671385e", - "reference": "a1066c562c52900a142a0e2bbf0582994671385e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c062dddcb68e44b563f66ee319ddae2b5a322a90", + "reference": "c062dddcb68e44b563f66ee319ddae2b5a322a90", "shasum": "" }, "require": { @@ -1105,7 +1379,7 @@ "phpunit/php-code-coverage": "~2.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", @@ -1118,7 +1392,7 @@ "suggest": { "phpunit/php-invoker": "~1.1" }, - "time": "2016-03-14 06:16:08", + "time": "2016-07-21 06:48:14", "bin": [ "phpunit" ], @@ -1153,68 +1427,23 @@ "xunit" ] }, - { - "name": "react/promise", - "version": "v2.2.2", - "version_normalized": "2.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/reactphp/promise.git", - "reference": "3aacad8bf10c7d83e6fa2089d413529888c2bedf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/3aacad8bf10c7d83e6fa2089d413529888c2bedf", - "reference": "3aacad8bf10c7d83e6fa2089d413529888c2bedf", - "shasum": "" - }, - "require": { - "php": ">=5.4.0" - }, - "time": "2016-02-26 19:09:02", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "React\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jan Sorgalla", - "email": "jsorgalla@gmail.com" - } - ], - "description": "A lightweight implementation of CommonJS Promises/A for PHP" - }, { "name": "squizlabs/php_codesniffer", - "version": "2.5.1", - "version_normalized": "2.5.1.0", + "version": "2.6.2", + "version_normalized": "2.6.2.0", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8" + "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6731851d6aaf1d0d6c58feff1065227b7fda3ba8", - "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4edb770cb853def6e60c93abb088ad5ac2010c83", + "reference": "4edb770cb853def6e60c93abb088ad5ac2010c83", "shasum": "" }, "require": { + "ext-simplexml": "*", "ext-tokenizer": "*", "ext-xmlwriter": "*", "php": ">=5.1.2" @@ -1222,7 +1451,7 @@ "require-dev": { "phpunit/phpunit": "~4.0" }, - "time": "2016-01-19 23:39:10", + "time": "2016-07-13 23:29:13", "bin": [ "scripts/phpcs", "scripts/phpcbf" @@ -1277,82 +1506,5 @@ "phpcs", "standards" ] - }, - { - "name": "psr/log", - "version": "1.0.0", - "version_normalized": "1.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", - "shasum": "" - }, - "time": "2012-12-21 11:40:51", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "Psr\\Log\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "keywords": [ - "log", - "psr", - "psr-3" - ] - }, - { - "name": "cloudflare/cloudflare-plugin-backend", - "version": "1.0.1", - "version_normalized": "1.0.1.0", - "source": { - "type": "git", - "url": "https://github.com/cloudflare/cloudflare-plugin-backend.git", - "reference": "b5a1ab53627181318766fdc66ccb6dbfb4d1b965" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/cloudflare/cloudflare-plugin-backend/zipball/b5a1ab53627181318766fdc66ccb6dbfb4d1b965", - "reference": "b5a1ab53627181318766fdc66ccb6dbfb4d1b965", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "~5.0", - "psr/log": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "4.8.*", - "squizlabs/php_codesniffer": "2.*" - }, - "time": "2016-06-07 20:33:13", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "CF\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "A PHP backend for CloudFlare plugins." } ] diff --git a/vendor/guzzlehttp/guzzle/.editorconfig b/vendor/guzzlehttp/guzzle/.editorconfig deleted file mode 100644 index eab48ccf..00000000 --- a/vendor/guzzlehttp/guzzle/.editorconfig +++ /dev/null @@ -1,11 +0,0 @@ -# EditorConfig is awesome: http://EditorConfig.org - -# top-most EditorConfig file -root = true - -# Unix-style newlines with a newline ending for every file -# Indent with 4 spaces -[php] -end_of_line = lf -indent_style = space -indent_size = 4 diff --git a/vendor/guzzlehttp/guzzle/.gitignore b/vendor/guzzlehttp/guzzle/.gitignore deleted file mode 100644 index 83ec41e2..00000000 --- a/vendor/guzzlehttp/guzzle/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -phpunit.xml -composer.phar -composer.lock -composer-test.lock -vendor/ -build/artifacts/ -artifacts/ -docs/_build -docs/*.pyc -.idea -.DS_STORE diff --git a/vendor/guzzlehttp/guzzle/CHANGELOG.md b/vendor/guzzlehttp/guzzle/CHANGELOG.md index b46278b1..7bd0a720 100644 --- a/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -1,5 +1,12 @@ # CHANGELOG +## 5.3.1 - 2016-07-18 + +* Address HTTP_PROXY security vulnerability, CVE-2016-5385: + https://httpoxy.org/ +* Event name fix: https://github.com/guzzle/guzzle/commit/fcae91ff31de41e312fe113ec3acbcda31b2622e +* Response header case sensitivity fix: https://github.com/guzzle/guzzle/commit/043eeadf20ee40ddc6712faee4d3957a91f2b041 + ## 5.3.0 - 2015-05-19 * Mock now supports `save_to` diff --git a/vendor/guzzlehttp/guzzle/LICENSE b/vendor/guzzlehttp/guzzle/LICENSE index 71d3b783..9af9fba6 100644 --- a/vendor/guzzlehttp/guzzle/LICENSE +++ b/vendor/guzzlehttp/guzzle/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014 Michael Dowling, https://github.com/mtdowling +Copyright (c) 2011-2015 Michael Dowling, https://github.com/mtdowling Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/vendor/guzzlehttp/guzzle/Makefile b/vendor/guzzlehttp/guzzle/Makefile deleted file mode 100644 index 69bf3273..00000000 --- a/vendor/guzzlehttp/guzzle/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -all: clean coverage docs - -start-server: - cd vendor/guzzlehttp/ringphp && make start-server - -stop-server: - cd vendor/guzzlehttp/ringphp && make stop-server - -test: start-server - vendor/bin/phpunit - $(MAKE) stop-server - -coverage: start-server - vendor/bin/phpunit --coverage-html=artifacts/coverage - $(MAKE) stop-server - -view-coverage: - open artifacts/coverage/index.html - -clean: - rm -rf artifacts/* - -docs: - cd docs && make html && cd .. - -view-docs: - open docs/_build/html/index.html - -tag: - $(if $(TAG),,$(error TAG is not defined. Pass via "make tag TAG=4.2.1")) - @echo Tagging $(TAG) - chag update $(TAG) - sed -i '' -e "s/VERSION = '.*'/VERSION = '$(TAG)'/" src/ClientInterface.php - php -l src/ClientInterface.php - git add -A - git commit -m '$(TAG) release' - chag tag - -perf: start-server - php tests/perf.php - $(MAKE) stop-server - -package: burgomaster - php build/packager.php - -burgomaster: - mkdir -p build/artifacts - curl -s https://raw.githubusercontent.com/mtdowling/Burgomaster/0.0.2/src/Burgomaster.php > build/artifacts/Burgomaster.php - -.PHONY: docs burgomaster diff --git a/vendor/guzzlehttp/guzzle/build/packager.php b/vendor/guzzlehttp/guzzle/build/packager.php deleted file mode 100644 index 724bf634..00000000 --- a/vendor/guzzlehttp/guzzle/build/packager.php +++ /dev/null @@ -1,21 +0,0 @@ -deepCopy($file, $file); -} - -// Copy each dependency to the staging directory. Copy *.php and *.pem files. -$packager->recursiveCopy('src', 'GuzzleHttp', ['php']); -$packager->recursiveCopy('vendor/react/promise/src', 'React/Promise'); -$packager->recursiveCopy('vendor/guzzlehttp/ringphp/src', 'GuzzleHttp/Ring'); -$packager->recursiveCopy('vendor/guzzlehttp/streams/src', 'GuzzleHttp/Stream'); -$packager->createAutoloader(['React/Promise/functions.php']); -$packager->createPhar(__DIR__ . '/artifacts/guzzle.phar'); -$packager->createZip(__DIR__ . '/artifacts/guzzle.zip'); diff --git a/vendor/guzzlehttp/guzzle/composer.json b/vendor/guzzlehttp/guzzle/composer.json index 6ec7dad6..717b3be4 100644 --- a/vendor/guzzlehttp/guzzle/composer.json +++ b/vendor/guzzlehttp/guzzle/composer.json @@ -18,7 +18,6 @@ }, "require-dev": { "ext-curl": "*", - "psr/log": "^1.0", "phpunit/phpunit": "^4.0" }, "autoload": { @@ -30,10 +29,5 @@ "psr-4": { "GuzzleHttp\\Tests\\": "tests/" } - }, - "extra": { - "branch-alias": { - "dev-master": "5.0-dev" - } } } diff --git a/vendor/guzzlehttp/guzzle/docs/Makefile b/vendor/guzzlehttp/guzzle/docs/Makefile deleted file mode 100644 index d92e03f9..00000000 --- a/vendor/guzzlehttp/guzzle/docs/Makefile +++ /dev/null @@ -1,153 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - -rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Guzzle.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Guzzle.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/Guzzle" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Guzzle" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." diff --git a/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png b/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png deleted file mode 100644 index f1017f7e..00000000 Binary files a/vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png and /dev/null differ diff --git a/vendor/guzzlehttp/guzzle/docs/_static/logo.png b/vendor/guzzlehttp/guzzle/docs/_static/logo.png deleted file mode 100644 index 965a4ef4..00000000 Binary files a/vendor/guzzlehttp/guzzle/docs/_static/logo.png and /dev/null differ diff --git a/vendor/guzzlehttp/guzzle/docs/_templates/nav_links.html b/vendor/guzzlehttp/guzzle/docs/_templates/nav_links.html deleted file mode 100644 index 7950a0f8..00000000 --- a/vendor/guzzlehttp/guzzle/docs/_templates/nav_links.html +++ /dev/null @@ -1,3 +0,0 @@ -
  • GitHub
  • -
  • Forum
  • -
  • IRC
  • diff --git a/vendor/guzzlehttp/guzzle/docs/clients.rst b/vendor/guzzlehttp/guzzle/docs/clients.rst deleted file mode 100644 index 35a9806f..00000000 --- a/vendor/guzzlehttp/guzzle/docs/clients.rst +++ /dev/null @@ -1,1326 +0,0 @@ -======= -Clients -======= - -Clients are used to create requests, create transactions, send requests -through an HTTP handler, and return a response. You can add default request -options to a client that are applied to every request (e.g., default headers, -default query string parameters, etc.), and you can add event listeners and -subscribers to every request created by a client. - -Creating a client -================= - -The constructor of a client accepts an associative array of configuration -options. - -base_url - Configures a base URL for the client so that requests created - using a relative URL are combined with the ``base_url`` of the client - according to section `5.2 of RFC 3986 `_. - - .. code-block:: php - - // Create a client with a base URL - $client = new GuzzleHttp\Client(['base_url' => 'https://github.com']); - // Send a request to https://github.com/notifications - $response = $client->get('/notifications'); - - Don't feel like reading RFC 3986? Here are some quick examples on how a - ``base_url`` is resolved with another URI. - - ======================= ================== =============================== - base_url URI Result - ======================= ================== =============================== - ``http://foo.com`` ``/bar`` ``http://foo.com/bar`` - ``http://foo.com/foo`` ``/bar`` ``http://foo.com/bar`` - ``http://foo.com/foo`` ``bar`` ``http://foo.com/bar`` - ``http://foo.com/foo/`` ``bar`` ``http://foo.com/foo/bar`` - ``http://foo.com`` ``http://baz.com`` ``http://baz.com`` - ``http://foo.com/?bar`` ``bar`` ``http://foo.com/bar`` - ======================= ================== =============================== - -handler - Configures the `RingPHP handler `_ - used to transfer the HTTP requests of a client. Guzzle will, by default, - utilize a stacked handlers that chooses the best handler to use based on the - provided request options and based on the extensions available in the - environment. - -message_factory - Specifies the factory used to create HTTP requests and responses - (``GuzzleHttp\Message\MessageFactoryInterface``). - -defaults - Associative array of :ref:`request-options` that are applied to every - request created by the client. This allows you to specify things like - default headers (e.g., User-Agent), default query string parameters, SSL - configurations, and any other supported request options. - -emitter - Specifies an event emitter (``GuzzleHttp\Event\EmitterInterface``) instance - to be used by the client to emit request events. This option is useful if - you need to inject an emitter with listeners/subscribers already attached. - -Here's an example of creating a client with various options. - -.. code-block:: php - - use GuzzleHttp\Client; - - $client = new Client([ - 'base_url' => ['https://api.twitter.com/{version}/', ['version' => 'v1.1']], - 'defaults' => [ - 'headers' => ['Foo' => 'Bar'], - 'query' => ['testing' => '123'], - 'auth' => ['username', 'password'], - 'proxy' => 'tcp://localhost:80' - ] - ]); - -Sending Requests -================ - -Requests can be created using various methods of a client. You can create -**and** send requests using one of the following methods: - -- ``GuzzleHttp\Client::get``: Sends a GET request. -- ``GuzzleHttp\Client::head``: Sends a HEAD request -- ``GuzzleHttp\Client::post``: Sends a POST request -- ``GuzzleHttp\Client::put``: Sends a PUT request -- ``GuzzleHttp\Client::delete``: Sends a DELETE request -- ``GuzzleHttp\Client::options``: Sends an OPTIONS request - -Each of the above methods accepts a URL as the first argument and an optional -associative array of :ref:`request-options` as the second argument. - -Synchronous Requests --------------------- - -Guzzle sends synchronous (blocking) requests when the ``future`` request option -is not specified. This means that the request will complete immediately, and if -an error is encountered, a ``GuzzleHttp\Exception\RequestException`` will be -thrown. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - - $client->put('http://httpbin.org', [ - 'headers' => ['X-Foo' => 'Bar'], - 'body' => 'this is the body!', - 'save_to' => '/path/to/local/file', - 'allow_redirects' => false, - 'timeout' => 5 - ]); - -Synchronous Error Handling -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When a recoverable error is encountered while calling the ``send()`` method of -a client, a ``GuzzleHttp\Exception\RequestException`` is thrown. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Exception\RequestException; - - $client = new Client(); - - try { - $client->get('http://httpbin.org'); - } catch (RequestException $e) { - echo $e->getRequest() . "\n"; - if ($e->hasResponse()) { - echo $e->getResponse() . "\n"; - } - } - -``GuzzleHttp\Exception\RequestException`` always contains a -``GuzzleHttp\Message\RequestInterface`` object that can be accessed using the -exception's ``getRequest()`` method. - -A response might be present in the exception. In the event of a networking -error, no response will be received. You can check if a ``RequestException`` -has a response using the ``hasResponse()`` method. If the exception has a -response, then you can access the associated -``GuzzleHttp\Message\ResponseInterface`` using the ``getResponse()`` method of -the exception. - -Asynchronous Requests ---------------------- - -You can send asynchronous requests by setting the ``future`` request option -to ``true`` (or a string that your handler understands). This creates a -``GuzzleHttp\Message\FutureResponse`` object that has not yet completed. Once -you have a future response, you can use a promise object obtained by calling -the ``then`` method of the response to take an action when the response has -completed or encounters an error. - -.. code-block:: php - - $response = $client->put('http://httpbin.org/get', ['future' => true]); - - // Call the function when the response completes - $response->then(function ($response) { - echo $response->getStatusCode(); - }); - -You can call the ``wait()`` method of a future response to block until it has -completed. You also use a future response object just like a normal response -object by accessing the methods of the response. Using a future response like a -normal response object, also known as *dereferencing*, will block until the -response has completed. - -.. code-block:: php - - $response = $client->put('http://httpbin.org/get', ['future' => true]); - - // Block until the response has completed - echo $response->getStatusCode(); - -.. important:: - - If an exception occurred while transferring the future response, then the - exception encountered will be thrown when dereferencing. - -.. note:: - - It depends on the RingPHP handler used by a client, but you typically need - to use the same RingPHP handler in order to utilize asynchronous requests - across multiple clients. - -Asynchronous Error Handling -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Handling errors with future response object promises is a bit different. When -using a promise, exceptions are forwarded to the ``$onError`` function provided -to the second argument of the ``then()`` function. - -.. code-block:: php - - $response = $client->put('http://httpbin.org/get', ['future' => true]); - - $response - ->then( - function ($response) { - // This is called when the request succeeded - echo 'Success: ' . $response->getStatusCode(); - // Returning a value will forward the value to the next promise - // in the chain. - return $response; - }, - function ($error) { - // This is called when the exception failed. - echo 'Exception: ' . $error->getMessage(); - // Throwing will "forward" the exception to the next promise - // in the chain. - throw $error; - } - ) - ->then( - function($response) { - // This is called after the first promise in the chain. It - // receives the value returned from the first promise. - echo $response->getReasonPhrase(); - }, - function ($error) { - // This is called if the first promise error handler in the - // chain rethrows the exception. - echo 'Error: ' . $error->getMessage(); - } - ); - -Please see the `React/Promises project documentation `_ -for more information on how promise resolution and rejection forwarding works. - -HTTP Errors ------------ - -If the ``exceptions`` request option is not set to ``false``, then exceptions -are thrown for HTTP protocol errors as well: -``GuzzleHttp\Exception\ClientErrorResponseException`` for 4xx level HTTP -responses and ``GuzzleHttp\Exception\ServerException`` for 5xx level responses, -both of which extend from ``GuzzleHttp\Exception\BadResponseException``. - -Creating Requests ------------------ - -You can create a request without sending it. This is useful for building up -requests over time or sending requests in concurrently. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httpbin.org', [ - 'headers' => ['X-Foo' => 'Bar'] - ]); - - // Modify the request as needed - $request->setHeader('Baz', 'bar'); - -After creating a request, you can send it with the client's ``send()`` method. - -.. code-block:: php - - $response = $client->send($request); - -Sending Requests With a Pool -============================ - -You can send requests concurrently using a fixed size pool via the -``GuzzleHttp\Pool`` class. The Pool class is an implementation of -``GuzzleHttp\Ring\Future\FutureInterface``, meaning it can be dereferenced at a -later time or cancelled before sending. The Pool constructor accepts a client -object, iterator or array that yields ``GuzzleHttp\Message\RequestInterface`` -objects, and an optional associative array of options that can be used to -affect the transfer. - -.. code-block:: php - - use GuzzleHttp\Pool; - - $requests = [ - $client->createRequest('GET', 'http://httpbin.org'), - $client->createRequest('DELETE', 'http://httpbin.org/delete'), - $client->createRequest('PUT', 'http://httpbin.org/put', ['body' => 'test']) - ]; - - $options = []; - - // Create a pool. Note: the options array is optional. - $pool = new Pool($client, $requests, $options); - - // Send the requests - $pool->wait(); - -The Pool constructor accepts the following associative array of options: - -- **pool_size**: Integer representing the maximum number of requests that are - allowed to be sent concurrently. -- **before**: Callable or array representing the event listeners to add to - each request's :ref:`before_event` event. -- **complete**: Callable or array representing the event listeners to add to - each request's :ref:`complete_event` event. -- **error**: Callable or array representing the event listeners to add to - each request's :ref:`error_event` event. -- **end**: Callable or array representing the event listeners to add to - each request's :ref:`end_event` event. - -The "before", "complete", "error", and "end" event options accept a callable or -an array of associative arrays where each associative array contains a "fn" key -with a callable value, an optional "priority" key representing the event -priority (with a default value of 0), and an optional "once" key that can be -set to true so that the event listener will be removed from the request after -it is first triggered. - -.. code-block:: php - - use GuzzleHttp\Pool; - use GuzzleHttp\Event\CompleteEvent; - - // Add a single event listener using a callable. - Pool::send($client, $requests, [ - 'complete' => function (CompleteEvent $event) { - echo 'Completed request to ' . $event->getRequest()->getUrl() . "\n"; - echo 'Response: ' . $event->getResponse()->getBody() . "\n\n"; - } - ]); - - // The above is equivalent to the following, but the following structure - // allows you to add multiple event listeners to the same event name. - Pool::send($client, $requests, [ - 'complete' => [ - [ - 'fn' => function (CompleteEvent $event) { /* ... */ }, - 'priority' => 0, // Optional - 'once' => false // Optional - ] - ] - ]); - -Asynchronous Response Handling ------------------------------- - -When sending requests concurrently using a pool, the request/response/error -lifecycle must be handled asynchronously. This means that you give the Pool -multiple requests and handle the response or errors that is associated with the -request using event callbacks. - -.. code-block:: php - - use GuzzleHttp\Pool; - use GuzzleHttp\Event\ErrorEvent; - - Pool::send($client, $requests, [ - 'complete' => function (CompleteEvent $event) { - echo 'Completed request to ' . $event->getRequest()->getUrl() . "\n"; - echo 'Response: ' . $event->getResponse()->getBody() . "\n\n"; - // Do something with the completion of the request... - }, - 'error' => function (ErrorEvent $event) { - echo 'Request failed: ' . $event->getRequest()->getUrl() . "\n"; - echo $event->getException(); - // Do something to handle the error... - } - ]); - -The ``GuzzleHttp\Event\ErrorEvent`` event object is emitted when an error -occurs during a transfer. With this event, you have access to the request that -was sent, the response that was received (if one was received), access to -transfer statistics, and the ability to intercept the exception with a -different ``GuzzleHttp\Message\ResponseInterface`` object. See :doc:`events` -for more information. - -Handling Errors After Transferring -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -It sometimes might be easier to handle all of the errors that occurred during a -transfer after all of the requests have been sent. Here we are adding each -failed request to an array that we can use to process errors later. - -.. code-block:: php - - use GuzzleHttp\Pool; - use GuzzleHttp\Event\ErrorEvent; - - $errors = []; - Pool::send($client, $requests, [ - 'error' => function (ErrorEvent $event) use (&$errors) { - $errors[] = $event; - } - ]); - - foreach ($errors as $error) { - // Handle the error... - } - -.. _batch-requests: - -Batching Requests ------------------ - -Sometimes you just want to send a few requests concurrently and then process -the results all at once after they've been sent. Guzzle provides a convenience -function ``GuzzleHttp\Pool::batch()`` that makes this very simple: - -.. code-block:: php - - use GuzzleHttp\Pool; - use GuzzleHttp\Client; - - $client = new Client(); - - $requests = [ - $client->createRequest('GET', 'http://httpbin.org/get'), - $client->createRequest('HEAD', 'http://httpbin.org/get'), - $client->createRequest('PUT', 'http://httpbin.org/put'), - ]; - - // Results is a GuzzleHttp\BatchResults object. - $results = Pool::batch($client, $requests); - - // Can be accessed by index. - echo $results[0]->getStatusCode(); - - // Can be accessed by request. - echo $results->getResult($requests[0])->getStatusCode(); - - // Retrieve all successful responses - foreach ($results->getSuccessful() as $response) { - echo $response->getStatusCode() . "\n"; - } - - // Retrieve all failures. - foreach ($results->getFailures() as $requestException) { - echo $requestException->getMessage() . "\n"; - } - -``GuzzleHttp\Pool::batch()`` accepts an optional associative array of options -in the third argument that allows you to specify the 'before', 'complete', -'error', and 'end' events as well as specify the maximum number of requests to -send concurrently using the 'pool_size' option key. - -.. _request-options: - -Request Options -=============== - -You can customize requests created by a client using **request options**. -Request options control various aspects of a request including, headers, -query string parameters, timeout settings, the body of a request, and much -more. - -All of the following examples use the following client: - -.. code-block:: php - - $client = new GuzzleHttp\Client(['base_url' => 'http://httpbin.org']); - -headers -------- - -:Summary: Associative array of headers to add to the request. Each key is the - name of a header, and each value is a string or array of strings - representing the header field values. -:Types: array -:Defaults: None - -.. code-block:: php - - // Set various headers on a request - $client->get('/get', [ - 'headers' => [ - 'User-Agent' => 'testing/1.0', - 'Accept' => 'application/json', - 'X-Foo' => ['Bar', 'Baz'] - ] - ]); - -body ----- - -:Summary: The ``body`` option is used to control the body of an entity - enclosing request (e.g., PUT, POST, PATCH). -:Types: - - string - - ``fopen()`` resource - - ``GuzzleHttp\Stream\StreamInterface`` - - ``GuzzleHttp\Post\PostBodyInterface`` -:Default: None - -This setting can be set to any of the following types: - -- string - - .. code-block:: php - - // You can send requests that use a string as the message body. - $client->put('/put', ['body' => 'foo']); - -- resource returned from ``fopen()`` - - .. code-block:: php - - // You can send requests that use a stream resource as the body. - $resource = fopen('http://httpbin.org', 'r'); - $client->put('/put', ['body' => $resource]); - -- Array - - Use an array to send POST style requests that use a - ``GuzzleHttp\Post\PostBodyInterface`` object as the body. - - .. code-block:: php - - // You can send requests that use a POST body containing fields & files. - $client->post('/post', [ - 'body' => [ - 'field' => 'abc', - 'other_field' => '123', - 'file_name' => fopen('/path/to/file', 'r') - ] - ]); - -- ``GuzzleHttp\Stream\StreamInterface`` - - .. code-block:: php - - // You can send requests that use a Guzzle stream object as the body - $stream = GuzzleHttp\Stream\Stream::factory('contents...'); - $client->post('/post', ['body' => $stream]); - -json ----- - -:Summary: The ``json`` option is used to easily upload JSON encoded data as the - body of a request. A Content-Type header of ``application/json`` will be - added if no Content-Type header is already present on the message. -:Types: - Any PHP type that can be operated on by PHP's ``json_encode()`` function. -:Default: None - -.. code-block:: php - - $request = $client->createRequest('PUT', '/put', ['json' => ['foo' => 'bar']]); - echo $request->getHeader('Content-Type'); - // application/json - echo $request->getBody(); - // {"foo":"bar"} - -.. note:: - - This request option does not support customizing the Content-Type header - or any of the options from PHP's `json_encode() `_ - function. If you need to customize these settings, then you must pass the - JSON encoded data into the request yourself using the ``body`` request - option and you must specify the correct Content-Type header using the - ``headers`` request option. - -query ------ - -:Summary: Associative array of query string values to add to the request. -:Types: - - array - - ``GuzzleHttp\Query`` -:Default: None - -.. code-block:: php - - // Send a GET request to /get?foo=bar - $client->get('/get', ['query' => ['foo' => 'bar']]); - -Query strings specified in the ``query`` option are combined with any query -string values that are parsed from the URL. - -.. code-block:: php - - // Send a GET request to /get?abc=123&foo=bar - $client->get('/get?abc=123', ['query' => ['foo' => 'bar']]); - -auth ----- - -:Summary: Pass an array of HTTP authentication parameters to use with the - request. The array must contain the username in index [0], the password in - index [1], and you can optionally provide a built-in authentication type in - index [2]. Pass ``null`` to disable authentication for a request. -:Types: - - array - - string - - null -:Default: None - -The built-in authentication types are as follows: - -basic - Use `basic HTTP authentication `_ in - the ``Authorization`` header (the default setting used if none is - specified). - - .. code-block:: php - - $client->get('/get', ['auth' => ['username', 'password']]); - -digest - Use `digest authentication `_ (must be - supported by the HTTP handler). - - .. code-block:: php - - $client->get('/get', ['auth' => ['username', 'password', 'digest']]); - - *This is currently only supported when using the cURL handler, but creating - a replacement that can be used with any HTTP handler is planned.* - -.. important:: - - The authentication type (whether it's provided as a string or as the third - option in an array) is always converted to a lowercase string. Take this - into account when implementing custom authentication types and when - implementing custom message factories. - -Custom Authentication Schemes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -You can also provide a string representing a custom authentication type name. -When using a custom authentication type string, you will need to implement -the authentication method in an event listener that checks the ``auth`` request -option of a request before it is sent. Authentication listeners that require -a request is not modified after they are signed should have a very low priority -to ensure that they are fired last or near last in the event chain. - -.. code-block:: php - - use GuzzleHttp\Event\BeforeEvent; - use GuzzleHttp\Event\RequestEvents; - - /** - * Custom authentication listener that handles the "foo" auth type. - * - * Listens to the "before" event of a request and only modifies the request - * when the "auth" config setting of the request is "foo". - */ - class FooAuth implements GuzzleHttp\Event\SubscriberInterface - { - private $password; - - public function __construct($password) - { - $this->password = $password; - } - - public function getEvents() - { - return ['before' => ['sign', RequestEvents::SIGN_REQUEST]]; - } - - public function sign(BeforeEvent $e) - { - if ($e->getRequest()->getConfig()['auth'] == 'foo') { - $e->getRequest()->setHeader('X-Foo', 'Foo ' . $this->password); - } - } - } - - $client->getEmitter()->attach(new FooAuth('password')); - $client->get('/', ['auth' => 'foo']); - -Adapter Specific Authentication Schemes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If you need to use authentication methods provided by cURL (e.g., NTLM, GSS, -etc.), then you need to specify a curl handler option in the ``options`` -request option array. See :ref:`config-option` for more information. - -.. _cookies-option: - -cookies -------- - -:Summary: Specifies whether or not cookies are used in a request or what cookie - jar to use or what cookies to send. -:Types: - - bool - - array - - ``GuzzleHttp\Cookie\CookieJarInterface`` -:Default: None - -Set to ``true`` to use a shared cookie session associated with the client. - -.. code-block:: php - - // Enable cookies using the shared cookie jar of the client. - $client->get('/get', ['cookies' => true]); - -Pass an associative array containing cookies to send in the request and start a -new cookie session. - -.. code-block:: php - - // Enable cookies and send specific cookies - $client->get('/get', ['cookies' => ['foo' => 'bar']]); - -Set to a ``GuzzleHttp\Cookie\CookieJarInterface`` object to use an existing -cookie jar. - -.. code-block:: php - - $jar = new GuzzleHttp\Cookie\CookieJar(); - $client->get('/get', ['cookies' => $jar]); - -.. _allow_redirects-option: - -allow_redirects ---------------- - -:Summary: Describes the redirect behavior of a request -:Types: - - bool - - array -:Default: - :: - - [ - 'max' => 5, - 'strict' => false, - 'referer' => true, - 'protocols' => ['http', 'https'] - ] - -Set to ``false`` to disable redirects. - -.. code-block:: php - - $res = $client->get('/redirect/3', ['allow_redirects' => false]); - echo $res->getStatusCode(); - // 302 - -Set to ``true`` (the default setting) to enable normal redirects with a maximum -number of 5 redirects. - -.. code-block:: php - - $res = $client->get('/redirect/3'); - echo $res->getStatusCode(); - // 200 - -Pass an associative array containing the 'max' key to specify the maximum -number of redirects, provide a 'strict' key value to specify whether or not to -use strict RFC compliant redirects (meaning redirect POST requests with POST -requests vs. doing what most browsers do which is redirect POST requests with -GET requests), provide a 'referer' key to specify whether or not the "Referer" -header should be added when redirecting, and provide a 'protocols' array that -specifies which protocols are supported for redirects (defaults to -``['http', 'https']``). - -.. code-block:: php - - $res = $client->get('/redirect/3', [ - 'allow_redirects' => [ - 'max' => 10, // allow at most 10 redirects. - 'strict' => true, // use "strict" RFC compliant redirects. - 'referer' => true, // add a Referer header - 'protocols' => ['https'] // only allow https URLs - ] - ]); - echo $res->getStatusCode(); - // 200 - -decode_content --------------- - -:Summary: Specify whether or not ``Content-Encoding`` responses (gzip, - deflate, etc.) are automatically decoded. -:Types: - - string - - bool -:Default: ``true`` - -This option can be used to control how content-encoded response bodies are -handled. By default, ``decode_content`` is set to true, meaning any gzipped -or deflated response will be decoded by Guzzle. - -When set to ``false``, the body of a response is never decoded, meaning the -bytes pass through the handler unchanged. - -.. code-block:: php - - // Request gzipped data, but do not decode it while downloading - $client->get('/foo.js', [ - 'headers' => ['Accept-Encoding' => 'gzip'], - 'decode_content' => false - ]); - -When set to a string, the bytes of a response are decoded and the string value -provided to the ``decode_content`` option is passed as the ``Accept-Encoding`` -header of the request. - -.. code-block:: php - - // Pass "gzip" as the Accept-Encoding header. - $client->get('/foo.js', ['decode_content' => 'gzip']); - -.. _save_to-option: - -save_to -------- - -:Summary: Specify where the body of a response will be saved. -:Types: - - string - - ``fopen()`` resource - - ``GuzzleHttp\Stream\StreamInterface`` -:Default: PHP temp stream - -Pass a string to specify the path to a file that will store the contents of the -response body: - -.. code-block:: php - - $client->get('/stream/20', ['save_to' => '/path/to/file']); - -Pass a resource returned from ``fopen()`` to write the response to a PHP stream: - -.. code-block:: php - - $resource = fopen('/path/to/file', 'w'); - $client->get('/stream/20', ['save_to' => $resource]); - -Pass a ``GuzzleHttp\Stream\StreamInterface`` object to stream the response body -to an open Guzzle stream: - -.. code-block:: php - - $resource = fopen('/path/to/file', 'w'); - $stream = GuzzleHttp\Stream\Stream::factory($resource); - $client->get('/stream/20', ['save_to' => $stream]); - -.. _events-option: - -events ------- - -:Summary: An associative array mapping event names to a callable. Or an - associative array containing the 'fn' key that maps to a callable, an - optional 'priority' key used to specify the event priority, and an optional - 'once' key used to specify if the event should remove itself the first time - it is triggered. -:Types: array -:Default: None - -.. code-block:: php - - use GuzzleHttp\Event\BeforeEvent; - use GuzzleHttp\Event\HeadersEvent; - use GuzzleHttp\Event\CompleteEvent; - use GuzzleHttp\Event\ErrorEvent; - - $client->get('/', [ - 'events' => [ - 'before' => function (BeforeEvent $e) { echo 'Before'; }, - 'complete' => function (CompleteEvent $e) { echo 'Complete'; }, - 'error' => function (ErrorEvent $e) { echo 'Error'; }, - ] - ]); - -Here's an example of using the associative array format for control over the -priority and whether or not an event should be triggered more than once. - -.. code-block:: php - - $client->get('/', [ - 'events' => [ - 'before' => [ - 'fn' => function (BeforeEvent $e) { echo 'Before'; }, - 'priority' => 100, - 'once' => true - ] - ] - ]); - -.. _subscribers-option: - -subscribers ------------ - -:Summary: Array of event subscribers to add to the request. Each value in the - array must be an instance of ``GuzzleHttp\Event\SubscriberInterface``. -:Types: array -:Default: None - -.. code-block:: php - - use GuzzleHttp\Subscriber\History; - use GuzzleHttp\Subscriber\Mock; - use GuzzleHttp\Message\Response; - - $history = new History(); - $mock = new Mock([new Response(200)]); - $client->get('/', ['subscribers' => [$history, $mock]]); - - echo $history; - // Outputs the request and response history - -.. _exceptions-option: - -exceptions ----------- - -:Summary: Set to ``false`` to disable throwing exceptions on an HTTP protocol - errors (i.e., 4xx and 5xx responses). Exceptions are thrown by default when - HTTP protocol errors are encountered. -:Types: bool -:Default: ``true`` - -.. code-block:: php - - $client->get('/status/500'); - // Throws a GuzzleHttp\Exception\ServerException - - $res = $client->get('/status/500', ['exceptions' => false]); - echo $res->getStatusCode(); - // 500 - -.. _timeout-option: - -timeout -------- - -:Summary: Float describing the timeout of the request in seconds. Use ``0`` - to wait indefinitely (the default behavior). -:Types: float -:Default: ``0`` - -.. code-block:: php - - // Timeout if a server does not return a response in 3.14 seconds. - $client->get('/delay/5', ['timeout' => 3.14]); - // PHP Fatal error: Uncaught exception 'GuzzleHttp\Exception\RequestException' - -.. _connect_timeout-option: - -connect_timeout ---------------- - -:Summary: Float describing the number of seconds to wait while trying to connect - to a server. Use ``0`` to wait indefinitely (the default behavior). -:Types: float -:Default: ``0`` - -.. code-block:: php - - // Timeout if the client fails to connect to the server in 3.14 seconds. - $client->get('/delay/5', ['connect_timeout' => 3.14]); - -.. note:: - - This setting must be supported by the HTTP handler used to send a request. - ``connect_timeout`` is currently only supported by the built-in cURL - handler. - -.. _verify-option: - -verify ------- - -:Summary: Describes the SSL certificate verification behavior of a request. - - - Set to ``true`` to enable SSL certificate verification and use the default - CA bundle provided by operating system. - - Set to ``false`` to disable certificate verification (this is insecure!). - - Set to a string to provide the path to a CA bundle to enable verification - using a custom certificate. -:Types: - - bool - - string -:Default: ``true`` - -.. code-block:: php - - // Use the system's CA bundle (this is the default setting) - $client->get('/', ['verify' => true]); - - // Use a custom SSL certificate on disk. - $client->get('/', ['verify' => '/path/to/cert.pem']); - - // Disable validation entirely (don't do this!). - $client->get('/', ['verify' => false]); - -Not all system's have a known CA bundle on disk. For example, Windows and -OS X do not have a single common location for CA bundles. When setting -"verify" to ``true``, Guzzle will do its best to find the most appropriate -CA bundle on your system. When using cURL or the PHP stream wrapper on PHP -versions >= 5.6, this happens by default. When using the PHP stream -wrapper on versions < 5.6, Guzzle tries to find your CA bundle in the -following order: - -1. Check if ``openssl.cafile`` is set in your php.ini file. -2. Check if ``curl.cainfo`` is set in your php.ini file. -3. Check if ``/etc/pki/tls/certs/ca-bundle.crt`` exists (Red Hat, CentOS, - Fedora; provided by the ca-certificates package) -4. Check if ``/etc/ssl/certs/ca-certificates.crt`` exists (Ubuntu, Debian; - provided by the ca-certificates package) -5. Check if ``/usr/local/share/certs/ca-root-nss.crt`` exists (FreeBSD; - provided by the ca_root_nss package) -6. Check if ``/usr/local/etc/openssl/cert.pem`` (OS X; provided by homebrew) -7. Check if ``C:\windows\system32\curl-ca-bundle.crt`` exists (Windows) -8. Check if ``C:\windows\curl-ca-bundle.crt`` exists (Windows) - -The result of this lookup is cached in memory so that subsequent calls -in the same process will return very quickly. However, when sending only -a single request per-process in something like Apache, you should consider -setting the ``openssl.cafile`` environment variable to the path on disk -to the file so that this entire process is skipped. - -If you do not need a specific certificate bundle, then Mozilla provides a -commonly used CA bundle which can be downloaded -`here `_ -(provided by the maintainer of cURL). Once you have a CA bundle available on -disk, you can set the "openssl.cafile" PHP ini setting to point to the path to -the file, allowing you to omit the "verify" request option. Much more detail on -SSL certificates can be found on the -`cURL website `_. - -.. _cert-option: - -cert ----- - -:Summary: Set to a string to specify the path to a file containing a PEM - formatted client side certificate. If a password is required, then set to - an array containing the path to the PEM file in the first array element - followed by the password required for the certificate in the second array - element. -:Types: - - string - - array -:Default: None - -.. code-block:: php - - $client->get('/', ['cert' => ['/path/server.pem', 'password']]); - -.. _ssl_key-option: - -ssl_key -------- - -:Summary: Specify the path to a file containing a private SSL key in PEM - format. If a password is required, then set to an array containing the path - to the SSL key in the first array element followed by the password required - for the certificate in the second element. -:Types: - - string - - array -:Default: None - -.. note:: - - ``ssl_key`` is implemented by HTTP handlers. This is currently only - supported by the cURL handler, but might be supported by other third-part - handlers. - -.. _proxy-option: - -proxy ------ - -:Summary: Pass a string to specify an HTTP proxy, or an array to specify - different proxies for different protocols. -:Types: - - string - - array -:Default: None - -Pass a string to specify a proxy for all protocols. - -.. code-block:: php - - $client->get('/', ['proxy' => 'tcp://localhost:8125']); - -Pass an associative array to specify HTTP proxies for specific URI schemes -(i.e., "http", "https"). - -.. code-block:: php - - $client->get('/', [ - 'proxy' => [ - 'http' => 'tcp://localhost:8125', // Use this proxy with "http" - 'https' => 'tcp://localhost:9124' // Use this proxy with "https" - ] - ]); - -.. note:: - - You can provide proxy URLs that contain a scheme, username, and password. - For example, ``"http://username:password@192.168.16.1:10"``. - -.. _debug-option: - -debug ------ - -:Summary: Set to ``true`` or set to a PHP stream returned by ``fopen()`` to - enable debug output with the handler used to send a request. For example, - when using cURL to transfer requests, cURL's verbose of ``CURLOPT_VERBOSE`` - will be emitted. When using the PHP stream wrapper, stream wrapper - notifications will be emitted. If set to true, the output is written to - PHP's STDOUT. If a PHP stream is provided, output is written to the stream. -:Types: - - bool - - ``fopen()`` resource -:Default: None - -.. code-block:: php - - $client->get('/get', ['debug' => true]); - -Running the above example would output something like the following: - -:: - - * About to connect() to httpbin.org port 80 (#0) - * Trying 107.21.213.98... * Connected to httpbin.org (107.21.213.98) port 80 (#0) - > GET /get HTTP/1.1 - Host: httpbin.org - User-Agent: Guzzle/4.0 curl/7.21.4 PHP/5.5.7 - - < HTTP/1.1 200 OK - < Access-Control-Allow-Origin: * - < Content-Type: application/json - < Date: Sun, 16 Feb 2014 06:50:09 GMT - < Server: gunicorn/0.17.4 - < Content-Length: 335 - < Connection: keep-alive - < - * Connection #0 to host httpbin.org left intact - -.. _stream-option: - -stream ------- - -:Summary: Set to ``true`` to stream a response rather than download it all - up-front. -:Types: bool -:Default: ``false`` - -.. code-block:: php - - $response = $client->get('/stream/20', ['stream' => true]); - // Read bytes off of the stream until the end of the stream is reached - $body = $response->getBody(); - while (!$body->eof()) { - echo $body->read(1024); - } - -.. note:: - - Streaming response support must be implemented by the HTTP handler used by - a client. This option might not be supported by every HTTP handler, but the - interface of the response object remains the same regardless of whether or - not it is supported by the handler. - -.. _expect-option: - -expect ------- - -:Summary: Controls the behavior of the "Expect: 100-Continue" header. -:Types: - - bool - - integer -:Default: ``1048576`` - -Set to ``true`` to enable the "Expect: 100-Continue" header for all requests -that sends a body. Set to ``false`` to disable the "Expect: 100-Continue" -header for all requests. Set to a number so that the size of the payload must -be greater than the number in order to send the Expect header. Setting to a -number will send the Expect header for all requests in which the size of the -payload cannot be determined or where the body is not rewindable. - -By default, Guzzle will add the "Expect: 100-Continue" header when the size of -the body of a request is greater than 1 MB and a request is using HTTP/1.1. - -.. note:: - - This option only takes effect when using HTTP/1.1. The HTTP/1.0 and - HTTP/2.0 protocols do not support the "Expect: 100-Continue" header. - Support for handling the "Expect: 100-Continue" workflow must be - implemented by Guzzle HTTP handlers used by a client. - -.. _version-option: - -version -------- - -:Summary: Protocol version to use with the request. -:Types: string, float -:Default: ``1.1`` - -.. code-block:: php - - // Force HTTP/1.0 - $request = $client->createRequest('GET', '/get', ['version' => 1.0]); - echo $request->getProtocolVersion(); - // 1.0 - -.. _config-option: - -config ------- - -:Summary: Associative array of config options that are forwarded to a request's - configuration collection. These values are used as configuration options - that can be consumed by plugins and handlers. -:Types: array -:Default: None - -.. code-block:: php - - $request = $client->createRequest('GET', '/get', ['config' => ['foo' => 'bar']]); - echo $request->getConfig('foo'); - // 'bar' - -Some HTTP handlers allow you to specify custom handler-specific settings. For -example, you can pass custom cURL options to requests by passing an associative -array in the ``config`` request option under the ``curl`` key. - -.. code-block:: php - - // Use custom cURL options with the request. This example uses NTLM auth - // to authenticate with a server. - $client->get('/', [ - 'config' => [ - 'curl' => [ - CURLOPT_HTTPAUTH => CURLAUTH_NTLM, - CURLOPT_USERPWD => 'username:password' - ] - ] - ]); - -future ------- - -:Summary: Specifies whether or not a response SHOULD be an instance of a - ``GuzzleHttp\Message\FutureResponse`` object. -:Types: - - bool - - string -:Default: ``false`` - -By default, Guzzle requests should be synchronous. You can create asynchronous -future responses by passing the ``future`` request option as ``true``. The -response will only be executed when it is used like a normal response, the -``wait()`` method of the response is called, or the corresponding handler that -created the response is destructing and there are futures that have not been -resolved. - -.. important:: - - This option only has an effect if your handler can create and return future - responses. However, even if a response is completed synchronously, Guzzle - will ensure that a FutureResponse object is returned for API consistency. - -.. code-block:: php - - $response = $client->get('/foo', ['future' => true]) - ->then(function ($response) { - echo 'I got a response! ' . $response; - }); - -Event Subscribers -================= - -Requests emit lifecycle events when they are transferred. A client object has a -``GuzzleHttp\Common\EventEmitter`` object that can be used to add event -*listeners* and event *subscribers* to all requests created by the client. - -.. important:: - - **Every** event listener or subscriber added to a client will be added to - every request created by the client. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\BeforeEvent; - - $client = new Client(); - - // Add a listener that will echo out requests before they are sent - $client->getEmitter()->on('before', function (BeforeEvent $e) { - echo 'About to send request: ' . $e->getRequest(); - }); - - $client->get('http://httpbin.org/get'); - // Outputs the request as a string because of the event - -See :doc:`events` for more information on the event system used in Guzzle. - -Environment Variables -===================== - -Guzzle exposes a few environment variables that can be used to customize the -behavior of the library. - -``GUZZLE_CURL_SELECT_TIMEOUT`` - Controls the duration in seconds that a curl_multi_* handler will use when - selecting on curl handles using ``curl_multi_select()``. Some systems - have issues with PHP's implementation of ``curl_multi_select()`` where - calling this function always results in waiting for the maximum duration of - the timeout. -``HTTP_PROXY`` - Defines the proxy to use when sending requests using the "http" protocol. -``HTTPS_PROXY`` - Defines the proxy to use when sending requests using the "https" protocol. - -Relevant ini Settings ---------------------- - -Guzzle can utilize PHP ini settings when configuring clients. - -``openssl.cafile`` - Specifies the path on disk to a CA file in PEM format to use when sending - requests over "https". See: https://wiki.php.net/rfc/tls-peer-verification#phpini_defaults diff --git a/vendor/guzzlehttp/guzzle/docs/conf.py b/vendor/guzzlehttp/guzzle/docs/conf.py deleted file mode 100644 index 917bdf4c..00000000 --- a/vendor/guzzlehttp/guzzle/docs/conf.py +++ /dev/null @@ -1,28 +0,0 @@ -import sys, os -from sphinx.highlighting import lexers -from pygments.lexers.web import PhpLexer - - -lexers['php'] = PhpLexer(startinline=True, linenos=1) -lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) -primary_domain = 'php' - -extensions = [] -templates_path = ['_templates'] -source_suffix = '.rst' -master_doc = 'index' -project = u'Guzzle' -copyright = u'2014, Michael Dowling' -version = '5.0.0' -html_title = "Guzzle Documentation" -html_short_title = "Guzzle" - -exclude_patterns = ['_build'] -html_static_path = ['_static'] - -on_rtd = os.environ.get('READTHEDOCS', None) == 'True' - -if not on_rtd: # only import and set the theme if we're building docs locally - import sphinx_rtd_theme - html_theme = 'sphinx_rtd_theme' - html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] diff --git a/vendor/guzzlehttp/guzzle/docs/events.rst b/vendor/guzzlehttp/guzzle/docs/events.rst deleted file mode 100644 index 30afdb61..00000000 --- a/vendor/guzzlehttp/guzzle/docs/events.rst +++ /dev/null @@ -1,516 +0,0 @@ -============ -Event System -============ - -Guzzle uses an event emitter to allow you to easily extend the behavior of a -request, change the response associated with a request, and implement custom -error handling. All events in Guzzle are managed and emitted by an -**event emitter**. - -Event Emitters -============== - -Clients, requests, and any other class that implements the -``GuzzleHttp\Event\HasEmitterInterface`` interface have a -``GuzzleHttp\Event\Emitter`` object. You can add event *listeners* and -event *subscribers* to an event *emitter*. - -emitter - An object that implements ``GuzzleHttp\Event\EmitterInterface``. This - object emits named events to event listeners. You may register event - listeners on subscribers on an emitter. - -event listeners - Callable functions that are registered on an event emitter for specific - events. Event listeners are registered on an emitter with a *priority* - setting. If no priority is provided, ``0`` is used by default. - -event subscribers - Classes that tell an event emitter what methods to listen to and what - functions on the class to invoke when the event is triggered. Event - subscribers subscribe event listeners to an event emitter. They should be - used when creating more complex event based logic in applications (i.e., - cookie handling is implemented using an event subscriber because it's - easier to share a subscriber than an anonymous function and because - handling cookies is a complex process). - -priority - Describes the order in which event listeners are invoked when an event is - emitted. The higher a priority value, the earlier the event listener will - be invoked (a higher priority means the listener is more important). If - no priority is provided, the priority is assumed to be ``0``. - - When specifying an event priority, you can pass ``"first"`` or ``"last"`` to - dynamically specify the priority based on the current event priorities - associated with the given event name in the emitter. Use ``"first"`` to set - the priority to the current highest priority plus one. Use ``"last"`` to - set the priority to the current lowest event priority minus one. It is - important to remember that these dynamic priorities are calculated only at - the point of insertion into the emitter and they are not rearranged after - subsequent listeners are added to an emitter. - -propagation - Describes whether or not other event listeners are triggered. Event - emitters will trigger every event listener registered to a specific event - in priority order until all of the listeners have been triggered **or** - until the propagation of an event is stopped. - -Getting an EventEmitter ------------------------ - -You can get the event emitter of ``GuzzleHttp\Event\HasEmitterInterface`` -object using the the ``getEmitter()`` method. Here's an example of getting a -client object's event emitter. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $emitter = $client->getEmitter(); - -.. note:: - - You'll notice that the event emitter used in Guzzle is very similar to the - `Symfony2 EventDispatcher component `_. - This is because the Guzzle event system is based on the Symfony2 event - system with several changes. Guzzle uses its own event emitter to improve - performance, isolate Guzzle from changes to the Symfony, and provide a few - improvements that make it easier to use for an HTTP client (e.g., the - addition of the ``once()`` method). - -Adding Event Listeners ----------------------- - -After you have the emitter, you can register event listeners that listen to -specific events using the ``on()`` method. When registering an event listener, -you must tell the emitter what event to listen to (e.g., "before", "after", -"progress", "complete", "error", etc.), what callable to invoke when the -event is triggered, and optionally provide a priority. - -.. code-block:: php - - use GuzzleHttp\Event\BeforeEvent; - - $emitter->on('before', function (BeforeEvent $event) { - echo $event->getRequest(); - }); - -When a listener is triggered, it is passed an event that implements the -``GuzzleHttp\Event\EventInterface`` interface, the name of the event, and the -event emitter itself. The above example could more verbosely be written as -follows: - -.. code-block:: php - - use GuzzleHttp\Event\BeforeEvent; - - $emitter->on('before', function (BeforeEvent $event, $name) { - echo $event->getRequest(); - }); - -You can add an event listener that automatically removes itself after it is -triggered using the ``once()`` method of an event emitter. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $client->getEmitter()->once('before', function () { - echo 'This will only happen once... per request!'; - }); - -Event Propagation ------------------ - -Event listeners can prevent other event listeners from being triggered by -stopping an event's propagation. - -Stopping event propagation can be useful, for example, if an event listener has -changed the state of the subject to such an extent that allowing subsequent -event listeners to be triggered could place the subject in an inconsistent -state. This technique is used in Guzzle extensively when intercepting error -events with responses. - -You can stop the propagation of an event using the ``stopPropagation()`` method -of a ``GuzzleHttp\Event\EventInterface`` object: - -.. code-block:: php - - use GuzzleHttp\Event\ErrorEvent; - - $emitter->on('error', function (ErrorEvent $event) { - $event->stopPropagation(); - }); - -After stopping the propagation of an event, any subsequent event listeners that -have not yet been triggered will not be triggered. You can check to see if the -propagation of an event was stopped using the ``isPropagationStopped()`` method -of the event. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $emitter = $client->getEmitter(); - // Note: assume that the $errorEvent was created - if ($emitter->emit('error', $errorEvent)->isPropagationStopped()) { - echo 'It was stopped!'; - } - -.. hint:: - - When emitting events, the event that was emitted is returned from the - emitter. This allows you to easily chain calls as shown in the above - example. - -Event Subscribers ------------------ - -Event subscribers are classes that implement the -``GuzzleHttp\Event\SubscriberInterface`` object. They are used to register -one or more event listeners to methods of the class. Event subscribers tell -event emitters exactly which events to listen to and what method to invoke on -the class when the event is triggered by called the ``getEvents()`` method of -a subscriber. - -The following example registers event listeners to the ``before`` and -``complete`` event of a request. When the ``before`` event is emitted, the -``onBefore`` instance method of the subscriber is invoked. When the -``complete`` event is emitted, the ``onComplete`` event of the subscriber is -invoked. Each array value in the ``getEvents()`` return value MUST -contain the name of the method to invoke and can optionally contain the -priority of the listener (as shown in the ``before`` listener in the example). - -.. code-block:: php - - use GuzzleHttp\Event\EmitterInterface; - use GuzzleHttp\Event\SubscriberInterface; - use GuzzleHttp\Event\BeforeEvent; - use GuzzleHttp\Event\CompleteEvent; - - class SimpleSubscriber implements SubscriberInterface - { - public function getEvents() - { - return [ - // Provide name and optional priority - 'before' => ['onBefore', 100], - 'complete' => ['onComplete'], - // You can pass a list of listeners with different priorities - 'error' => [['beforeError', 'first'], ['afterError', 'last']] - ]; - } - - public function onBefore(BeforeEvent $event, $name) - { - echo 'Before!'; - } - - public function onComplete(CompleteEvent $event, $name) - { - echo 'Complete!'; - } - } - -To register the listeners the subscriber needs to be attached to the emitter: - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $emitter = $client->getEmitter(); - $subscriber = new SimpleSubscriber(); - $emitter->attach($subscriber); - - //to remove the listeners - $emitter->detach($subscriber); - -.. note:: - - You can specify event priorities using integers or ``"first"`` and - ``"last"`` to dynamically determine the priority. - -Event Priorities -================ - -When adding event listeners or subscribers, you can provide an optional event -priority. This priority is used to determine how early or late a listener is -triggered. Specifying the correct priority is an important aspect of ensuring -a listener behaves as expected. For example, if you wanted to ensure that -cookies associated with a redirect were added to a cookie jar, you'd need to -make sure that the listener that collects the cookies is triggered before the -listener that performs the redirect. - -In order to help make the process of determining the correct event priority of -a listener easier, Guzzle provides several pre-determined named event -priorities. These priorities are exposed as constants on the -``GuzzleHttp\Event\RequestEvents`` object. - -last - Use ``"last"`` as an event priority to set the priority to the current - lowest event priority minus one. - -first - Use ``"first"`` as an event priority to set the priority to the current - highest priority plus one. - -``GuzzleHttp\Event\RequestEvents::EARLY`` - Used when you want a listener to be triggered as early as possible in the - event chain. - -``GuzzleHttp\Event\RequestEvents::LATE`` - Used when you want a listener to be to be triggered as late as possible in - the event chain. - -``GuzzleHttp\Event\RequestEvents::PREPARE_REQUEST`` - Used when you want a listener to be trigger while a request is being - prepared during the ``before`` event. This event priority is used by the - ``GuzzleHttp\Subscriber\Prepare`` event subscriber which is responsible for - guessing a Content-Type, Content-Length, and Expect header of a request. - You should subscribe after this event is triggered if you want to ensure - that this subscriber has already been triggered. - -``GuzzleHttp\Event\RequestEvents::SIGN_REQUEST`` - Used when you want a listener to be triggered when a request is about to be - signed. Any listener triggered at this point should expect that the request - object will no longer be mutated. If you are implementing a custom - signature subscriber, then you should use this event priority to sign - requests. - -``GuzzleHttp\Event\RequestEvents::VERIFY_RESPONSE`` - Used when you want a listener to be triggered when a response is being - validated during the ``complete`` event. The - ``GuzzleHttp\Subscriber\HttpError`` event subscriber uses this event - priority to check if an exception should be thrown due to a 4xx or 5xx - level response status code. If you are doing any kind of verification of a - response during the complete event, it should happen at this priority. - -``GuzzleHttp\Event\RequestEvents::REDIRECT_RESPONSE`` - Used when you want a listener to be triggered when a response is being - redirected during the ``complete`` event. The - ``GuzzleHttp\Subscriber\Redirect`` event subscriber uses this event - priority when performing redirects. - -You can use the above event priorities as a guideline for determining the -priority of you event listeners. You can use these constants and add to or -subtract from them to ensure that a listener happens before or after the named -priority. - -.. note:: - - "first" and "last" priorities are not adjusted after they added to an - emitter. For example, if you add a listener with a priority of "first", - you can still add subsequent listeners with a higher priority which would - be triggered before the listener added with a priority of "first". - -Working With Request Events -=========================== - -Requests emit lifecycle events when they are transferred. - -.. important:: - - Excluding the ``end`` event, request lifecycle events may be triggered - multiple times due to redirects, retries, or reusing a request multiple - times. Use the ``once()`` method want the event to be triggered once. You - can also remove an event listener from an emitter by using the emitter which - is provided to the listener. - -.. _before_event: - -before ------- - -The ``before`` event is emitted before a request is sent. The event emitted is -a ``GuzzleHttp\Event\BeforeEvent``. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\EmitterInterface; - use GuzzleHttp\Event\BeforeEvent; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('GET', '/'); - $request->getEmitter()->on( - 'before', - function (BeforeEvent $e, $name) { - echo $name . "\n"; - // "before" - echo $e->getRequest()->getMethod() . "\n"; - // "GET" / "POST" / "PUT" / etc. - echo get_class($e->getClient()); - // "GuzzleHttp\Client" - } - ); - -You can intercept a request with a response before the request is sent over the -wire. The ``intercept()`` method of the ``BeforeEvent`` accepts a -``GuzzleHttp\Message\ResponseInterface``. Intercepting the event will prevent -the request from being sent over the wire and stops the propagation of the -``before`` event, preventing subsequent event listeners from being invoked. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\BeforeEvent; - use GuzzleHttp\Message\Response; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('GET', '/status/500'); - $request->getEmitter()->on('before', function (BeforeEvent $e) { - $response = new Response(200); - $e->intercept($response); - }); - - $response = $client->send($request); - echo $response->getStatusCode(); - // 200 - -.. attention:: - - Any exception encountered while executing the ``before`` event will trigger - the ``error`` event of a request. - -.. _complete_event: - -complete --------- - -The ``complete`` event is emitted after a transaction completes and an entire -response has been received. The event is a ``GuzzleHttp\Event\CompleteEvent``. - -You can intercept the ``complete`` event with a different response if needed -using the ``intercept()`` method of the event. This can be useful, for example, -for changing the response for caching. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\CompleteEvent; - use GuzzleHttp\Message\Response; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('GET', '/status/302'); - $cachedResponse = new Response(200); - - $request->getEmitter()->on( - 'complete', - function (CompleteEvent $e) use ($cachedResponse) { - if ($e->getResponse()->getStatusCode() == 302) { - // Intercept the original transaction with the new response - $e->intercept($cachedResponse); - } - } - ); - - $response = $client->send($request); - echo $response->getStatusCode(); - // 200 - -.. attention:: - - Any ``GuzzleHttp\Exception\RequestException`` encountered while executing - the ``complete`` event will trigger the ``error`` event of a request. - -.. _error_event: - -error ------ - -The ``error`` event is emitted when a request fails (whether it's from a -networking error or an HTTP protocol error). The event emitted is a -``GuzzleHttp\Event\ErrorEvent``. - -This event is useful for retrying failed requests. Here's an example of -retrying failed basic auth requests by re-sending the original request with -a username and password. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\ErrorEvent; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('GET', '/basic-auth/foo/bar'); - $request->getEmitter()->on('error', function (ErrorEvent $e) { - if ($e->getResponse()->getStatusCode() == 401) { - // Add authentication stuff as needed and retry the request - $e->getRequest()->setHeader('Authorization', 'Basic ' . base64_encode('foo:bar')); - // Get the client of the event and retry the request - $newResponse = $e->getClient()->send($e->getRequest()); - // Intercept the original transaction with the new response - $e->intercept($newResponse); - } - }); - -.. attention:: - - If an ``error`` event is intercepted with a response, then the ``complete`` - event of a request is triggered. If the ``complete`` event fails, then the - ``error`` event is triggered once again. - -.. _progress_event: - -progress --------- - -The ``progress`` event is emitted when data is uploaded or downloaded. The -event emitted is a ``GuzzleHttp\Event\ProgressEvent``. - -You can access the emitted progress values using the corresponding public -properties of the event object: - -- ``$downloadSize``: The number of bytes that will be downloaded (if known) -- ``$downloaded``: The number of bytes that have been downloaded -- ``$uploadSize``: The number of bytes that will be uploaded (if known) -- ``$uploaded``: The number of bytes that have been uploaded - -This event cannot be intercepted. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\ProgressEvent; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('PUT', '/put', [ - 'body' => str_repeat('.', 100000) - ]); - - $request->getEmitter()->on('progress', function (ProgressEvent $e) { - echo 'Downloaded ' . $e->downloaded . ' of ' . $e->downloadSize . ' ' - . 'Uploaded ' . $e->uploaded . ' of ' . $e->uploadSize . "\r"; - }); - - $client->send($request); - echo "\n"; - -.. _end_event: - -end ---- - -The ``end`` event is a terminal event, emitted once per request, that provides -access to the response that was received or the exception that was encountered. -The event emitted is a ``GuzzleHttp\Event\EndEvent``. - -This event can be intercepted, but keep in mind that the ``complete`` event -will not fire after intercepting this event. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Event\EndEvent; - - $client = new Client(['base_url' => 'http://httpbin.org']); - $request = $client->createRequest('PUT', '/put', [ - 'body' => str_repeat('.', 100000) - ]); - - $request->getEmitter()->on('end', function (EndEvent $e) { - if ($e->getException()) { - echo 'Error: ' . $e->getException()->getMessage(); - } else { - echo 'Response: ' . $e->getResponse(); - } - }); - - $client->send($request); - echo "\n"; diff --git a/vendor/guzzlehttp/guzzle/docs/faq.rst b/vendor/guzzlehttp/guzzle/docs/faq.rst deleted file mode 100644 index a8e9ad06..00000000 --- a/vendor/guzzlehttp/guzzle/docs/faq.rst +++ /dev/null @@ -1,199 +0,0 @@ -=== -FAQ -=== - -Why should I use Guzzle? -======================== - -Guzzle makes it easy to send HTTP requests and super simple to integrate with -web services. Guzzle manages things like persistent connections, represents -query strings as collections, makes it simple to send streaming POST requests -with fields and files, and abstracts away the underlying HTTP transport layer. -By providing an object oriented interface for HTTP clients, requests, responses, -headers, and message bodies, Guzzle makes it so that you no longer need to fool -around with cURL options, stream contexts, or sockets. - -**Asynchronous and Synchronous Requests** - -Guzzle allows you to send both asynchronous and synchronous requests using the -same interface and no direct dependency on an event loop. This flexibility -allows Guzzle to send an HTTP request using the most appropriate HTTP handler -based on the request being sent. For example, when sending synchronous -requests, Guzzle will by default send requests using cURL easy handles to -ensure you're using the fastest possible method for serially transferring HTTP -requests. When sending asynchronous requests, Guzzle might use cURL's multi -interface or any other asynchronous handler you configure. When you request -streaming data, Guzzle will by default use PHP's stream wrapper. - -**Streams** - -Request and response message bodies use :doc:`Guzzle Streams `, -allowing you to stream data without needing to load it all into memory. -Guzzle's stream layer provides a large suite of functionality: - -- You can modify streams at runtime using custom or a number of - pre-made decorators. -- You can emit progress events as data is read from a stream. -- You can validate the integrity of a stream using a rolling hash as data is - read from a stream. - -**Event System and Plugins** - -Guzzle's event system allows you to completely modify the behavior of a client -or request at runtime to cater them for any API. You can send a request with a -client, and the client can do things like automatically retry your request if -it fails, automatically redirect, log HTTP messages that are sent over the -wire, emit progress events as data is uploaded and downloaded, sign requests -using OAuth 1.0, verify the integrity of messages before and after they are -sent over the wire, and anything else you might need. - -**Testable** - -Another important aspect of Guzzle is that it's really -:doc:`easy to test clients `. You can mock HTTP responses and when -testing an handler implementation, Guzzle provides a mock node.js web server. - -**Ecosystem** - -Guzzle has a large `ecosystem of plugins `_, -including `service descriptions `_ -which allows you to abstract web services using service descriptions. These -service descriptions define how to serialize an HTTP request and how to parse -an HTTP response into a more meaningful model object. - -- `Guzzle Command `_: Provides the building - blocks for service description abstraction. -- `Guzzle Services `_: Provides an - implementation of "Guzzle Command" that utilizes Guzzle's service description - format. - -Does Guzzle require cURL? -========================= - -No. Guzzle can use any HTTP handler to send requests. This means that Guzzle -can be used with cURL, PHP's stream wrapper, sockets, and non-blocking libraries -like `React `_. You just need to configure a -`RingPHP `_ handler to use a -different method of sending requests. - -.. note:: - - Guzzle has historically only utilized cURL to send HTTP requests. cURL is - an amazing HTTP client (arguably the best), and Guzzle will continue to use - it by default when it is available. It is rare, but some developers don't - have cURL installed on their systems or run into version specific issues. - By allowing swappable HTTP handlers, Guzzle is now much more customizable - and able to adapt to fit the needs of more developers. - -Can Guzzle send asynchronous requests? -====================================== - -Yes. Pass the ``future`` true request option to a request to send it -asynchronously. Guzzle will then return a ``GuzzleHttp\Message\FutureResponse`` -object that can be used synchronously by accessing the response object like a -normal response, and it can be used asynchronously using a promise that is -notified when the response is resolved with a real response or rejected with an -exception. - -.. code-block:: php - - $request = $client->createRequest('GET', ['future' => true]); - $client->send($request)->then(function ($response) { - echo 'Got a response! ' . $response; - }); - -You can force an asynchronous response to complete using the ``wait()`` method -of a response. - -.. code-block:: php - - $request = $client->createRequest('GET', ['future' => true]); - $futureResponse = $client->send($request); - $futureResponse->wait(); - -How can I add custom cURL options? -================================== - -cURL offer a huge number of `customizable options `_. -While Guzzle normalizes many of these options across different handlers, there -are times when you need to set custom cURL options. This can be accomplished -by passing an associative array of cURL settings in the **curl** key of the -**config** request option. - -For example, let's say you need to customize the outgoing network interface -used with a client. - -.. code-block:: php - - $client->get('/', [ - 'config' => [ - 'curl' => [ - CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx' - ] - ] - ]); - -How can I add custom stream context options? -============================================ - -You can pass custom `stream context options `_ -using the **stream_context** key of the **config** request option. The -**stream_context** array is an associative array where each key is a PHP -transport, and each value is an associative array of transport options. - -For example, let's say you need to customize the outgoing network interface -used with a client and allow self-signed certificates. - -.. code-block:: php - - $client->get('/', [ - 'stream' => true, - 'config' => [ - 'stream_context' => [ - 'ssl' => [ - 'allow_self_signed' => true - ], - 'socket' => [ - 'bindto' => 'xxx.xxx.xxx.xxx' - ] - ] - ] - ]); - -Why am I getting an SSL verification error? -=========================================== - -You need to specify the path on disk to the CA bundle used by Guzzle for -verifying the peer certificate. See :ref:`verify-option`. - -What is this Maximum function nesting error? -============================================ - - Maximum function nesting level of '100' reached, aborting - -You could run into this error if you have the XDebug extension installed and -you execute a lot of requests in callbacks. This error message comes -specifically from the XDebug extension. PHP itself does not have a function -nesting limit. Change this setting in your php.ini to increase the limit:: - - xdebug.max_nesting_level = 1000 - -Why am I getting a 417 error response? -====================================== - -This can occur for a number of reasons, but if you are sending PUT, POST, or -PATCH requests with an ``Expect: 100-Continue`` header, a server that does not -support this header will return a 417 response. You can work around this by -setting the ``expect`` request option to ``false``: - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - - // Disable the expect header on a single request - $response = $client->put('/', [], 'the body', [ - 'expect' => false - ]); - - // Disable the expect header on all client requests - $client->setDefaultOption('expect', false) diff --git a/vendor/guzzlehttp/guzzle/docs/handlers.rst b/vendor/guzzlehttp/guzzle/docs/handlers.rst deleted file mode 100644 index d452003f..00000000 --- a/vendor/guzzlehttp/guzzle/docs/handlers.rst +++ /dev/null @@ -1,43 +0,0 @@ -================ -RingPHP Handlers -================ - -Guzzle uses RingPHP handlers to send HTTP requests over the wire. -RingPHP provides a low-level library that can be used to "glue" Guzzle with -any transport method you choose. By default, Guzzle utilizes cURL and PHP's -stream wrappers to send HTTP requests. - -RingPHP handlers makes it extremely simple to integrate Guzzle with any -HTTP transport. For example, you could quite easily bridge Guzzle and React -to use Guzzle in React's event loop. - -Using a handler ---------------- - -You can change the handler used by a client using the ``handler`` option in the -``GuzzleHttp\Client`` constructor. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Ring\Client\MockHandler; - - // Create a mock handler that always returns a 200 response. - $handler = new MockHandler(['status' => 200]); - - // Configure to client to use the mock handler. - $client = new Client(['handler' => $handler]); - -At its core, handlers are simply PHP callables that accept a request array -and return a ``GuzzleHttp\Ring\Future\FutureArrayInterface``. This future array -can be used just like a normal PHP array, causing it to block, or you can use -the promise interface using the ``then()`` method of the future. Guzzle hooks -up to the RingPHP project using a very simple bridge class -(``GuzzleHttp\RingBridge``). - -Creating a handler ------------------- - -See the `RingPHP `_ project -documentation for more information on creating custom handlers that can be -used with Guzzle clients. diff --git a/vendor/guzzlehttp/guzzle/docs/http-messages.rst b/vendor/guzzlehttp/guzzle/docs/http-messages.rst deleted file mode 100644 index 0c6527a8..00000000 --- a/vendor/guzzlehttp/guzzle/docs/http-messages.rst +++ /dev/null @@ -1,483 +0,0 @@ -============================= -Request and Response Messages -============================= - -Guzzle is an HTTP client that sends HTTP requests to a server and receives HTTP -responses. Both requests and responses are referred to as messages. - -Headers -======= - -Both request and response messages contain HTTP headers. - -Complex Headers ---------------- - -Some headers contain additional key value pair information. For example, Link -headers contain a link and several key value pairs: - -:: - - ; rel="thing"; type="image/jpeg" - -Guzzle provides a convenience feature that can be used to parse these types of -headers: - -.. code-block:: php - - use GuzzleHttp\Message\Request; - - $request = new Request('GET', '/', [ - 'Link' => '; rel="front"; type="image/jpeg"' - ]); - - $parsed = Request::parseHeader($request, 'Link'); - var_export($parsed); - -Will output: - -.. code-block:: php - - array ( - 0 => - array ( - 0 => '', - 'rel' => 'front', - 'type' => 'image/jpeg', - ), - ) - -The result contains a hash of key value pairs. Header values that have no key -(i.e., the link) are indexed numerically while headers parts that form a key -value pair are added as a key value pair. - -See :ref:`headers` for information on how the headers of a request and response -can be accessed and modified. - -Body -==== - -Both request and response messages can contain a body. - -You can check to see if a request or response has a body using the -``getBody()`` method: - -.. code-block:: php - - $response = GuzzleHttp\get('http://httpbin.org/get'); - if ($response->getBody()) { - echo $response->getBody(); - // JSON string: { ... } - } - -The body used in request and response objects is a -``GuzzleHttp\Stream\StreamInterface``. This stream is used for both uploading -data and downloading data. Guzzle will, by default, store the body of a message -in a stream that uses PHP temp streams. When the size of the body exceeds -2 MB, the stream will automatically switch to storing data on disk rather than -in memory (protecting your application from memory exhaustion). - -You can change the body used in a request or response using the ``setBody()`` -method: - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - $request = $client->createRequest('PUT', 'http://httpbin.org/put'); - $request->setBody(Stream::factory('foo')); - -The easiest way to create a body for a request is using the static -``GuzzleHttp\Stream\Stream::factory()`` method. This method accepts various -inputs like strings, resources returned from ``fopen()``, and other -``GuzzleHttp\Stream\StreamInterface`` objects. - -The body of a request or response can be cast to a string or you can read and -write bytes off of the stream as needed. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - $request = $client->createRequest('PUT', 'http://httpbin.org/put', ['body' => 'testing...']); - - echo $request->getBody()->read(4); - // test - echo $request->getBody()->read(4); - // ing. - echo $request->getBody()->read(1024); - // .. - var_export($request->eof()); - // true - -You can find out more about Guzzle stream objects in :doc:`streams`. - -Requests -======== - -Requests are sent from a client to a server. Requests include the method to -be applied to a resource, the identifier of the resource, and the protocol -version to use. - -Clients are used to create request messages. More precisely, clients use -a ``GuzzleHttp\Message\MessageFactoryInterface`` to create request messages. -You create requests with a client using the ``createRequest()`` method. - -.. code-block:: php - - // Create a request but don't send it immediately - $request = $client->createRequest('GET', 'http://httpbin.org/get'); - -Request Methods ---------------- - -When creating a request, you are expected to provide the HTTP method you wish -to perform. You can specify any method you'd like, including a custom method -that might not be part of RFC 7231 (like "MOVE"). - -.. code-block:: php - - // Create a request using a completely custom HTTP method - $request = $client->createRequest('MOVE', 'http://httpbin.org/move', ['exceptions' => false]); - - echo $request->getMethod(); - // MOVE - - $response = $client->send($request); - echo $response->getStatusCode(); - // 405 - -You can create and send a request using methods on a client that map to the -HTTP method you wish to use. - -:GET: ``$client->get('http://httpbin.org/get', [/** options **/])`` -:POST: ``$client->post('http://httpbin.org/post', [/** options **/])`` -:HEAD: ``$client->head('http://httpbin.org/get', [/** options **/])`` -:PUT: ``$client->put('http://httpbin.org/put', [/** options **/])`` -:DELETE: ``$client->delete('http://httpbin.org/delete', [/** options **/])`` -:OPTIONS: ``$client->options('http://httpbin.org/get', [/** options **/])`` -:PATCH: ``$client->patch('http://httpbin.org/put', [/** options **/])`` - -.. code-block:: php - - $response = $client->patch('http://httpbin.org/patch', ['body' => 'content']); - -Request URI ------------ - -The resource you are requesting with an HTTP request is identified by the -path of the request, the query string, and the "Host" header of the request. - -When creating a request, you can provide the entire resource URI as a URL. - -.. code-block:: php - - $response = $client->get('http://httbin.org/get?q=foo'); - -Using the above code, you will send a request that uses ``httpbin.org`` as -the Host header, sends the request over port 80, uses ``/get`` as the path, -and sends ``?q=foo`` as the query string. All of this is parsed automatically -from the provided URI. - -Sometimes you don't know what the entire request will be when it is created. -In these cases, you can modify the request as needed before sending it using -the ``createRequest()`` method of the client and methods on the request that -allow you to change it. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httbin.org'); - -You can change the path of the request using ``setPath()``: - -.. code-block:: php - - $request->setPath('/get'); - echo $request->getPath(); - // /get - echo $request->getUrl(); - // http://httpbin.com/get - -Scheme -~~~~~~ - -The `scheme `_ of a request -specifies the protocol to use when sending the request. When using Guzzle, the -scheme can be set to "http" or "https". - -You can change the scheme of the request using the ``setScheme()`` method: - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httbin.org'); - $request->setScheme('https'); - echo $request->getScheme(); - // https - echo $request->getUrl(); - // https://httpbin.com/get - -Port -~~~~ - -No port is necessary when using the "http" or "https" schemes, but you can -override the port using ``setPort()``. If you need to modify the port used with -the specified scheme from the default setting, then you must use the -``setPort()`` method. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httbin.org'); - $request->setPort(8080); - echo $request->getPort(); - // 8080 - echo $request->getUrl(); - // https://httpbin.com:8080/get - - // Set the port back to the default value for the scheme - $request->setPort(443); - echo $request->getUrl(); - // https://httpbin.com/get - -Query string -~~~~~~~~~~~~ - -You can get the query string of the request using the ``getQuery()`` method. -This method returns a ``GuzzleHttp\Query`` object. A Query object can be -accessed like a PHP array, iterated in a foreach statement like a PHP array, -and cast to a string. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httbin.org'); - $query = $request->getQuery(); - $query['foo'] = 'bar'; - $query['baz'] = 'bam'; - $query['bam'] = ['test' => 'abc']; - - echo $request->getQuery(); - // foo=bar&baz=bam&bam%5Btest%5D=abc - - echo $request->getQuery()['foo']; - // bar - echo $request->getQuery()->get('foo'); - // bar - echo $request->getQuery()->get('foo'); - // bar - - var_export($request->getQuery()['bam']); - // array('test' => 'abc') - - foreach ($query as $key => $value) { - var_export($value); - } - - echo $request->getUrl(); - // https://httpbin.com/get?foo=bar&baz=bam&bam%5Btest%5D=abc - -Query Aggregators -^^^^^^^^^^^^^^^^^ - -Query objects can store scalar values or arrays of values. When an array of -values is added to a query object, the query object uses a query aggregator to -convert the complex structure into a string. Query objects will use -`PHP style query strings `_ when complex -query string parameters are converted to a string. You can customize how -complex query string parameters are aggregated using the ``setAggregator()`` -method of a query string object. - -.. code-block:: php - - $query->setAggregator($query::duplicateAggregator()); - -In the above example, we've changed the query object to use the -"duplicateAggregator". This aggregator will allow duplicate entries to appear -in a query string rather than appending "[n]" to each value. So if you had a -query string with ``['a' => ['b', 'c']]``, the duplicate aggregator would -convert this to "a=b&a=c" while the default aggregator would convert this to -"a[0]=b&a[1]=c" (with urlencoded brackets). - -The ``setAggregator()`` method accepts a ``callable`` which is used to convert -a deeply nested array of query string variables into a flattened array of key -value pairs. The callable accepts an array of query data and returns a -flattened array of key value pairs where each value is an array of strings. -You can use the ``GuzzleHttp\Query::walkQuery()`` static function to easily -create custom query aggregators. - -Host -~~~~ - -You can change the host header of the request in a predictable way using the -``setHost()`` method of a request: - -.. code-block:: php - - $request->setHost('www.google.com'); - echo $request->getHost(); - // www.google.com - echo $request->getUrl(); - // https://www.google.com/get?foo=bar&baz=bam - -.. note:: - - The Host header can also be changed by modifying the Host header of a - request directly, but modifying the Host header directly could result in - sending a request to a different Host than what is specified in the Host - header (sometimes this is actually the desired behavior). - -Resource -~~~~~~~~ - -You can use the ``getResource()`` method of a request to return the path and -query string of a request in a single string. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httpbin.org/get?baz=bar'); - echo $request->getResource(); - // /get?baz=bar - -Request Config --------------- - -Request messages contain a configuration collection that can be used by -event listeners and HTTP handlers to modify how a request behaves or is -transferred over the wire. For example, many of the request options that are -specified when creating a request are actually set as config options that are -only acted upon by handlers and listeners when the request is sent. - -You can get access to the request's config object using the ``getConfig()`` -method of a request. - -.. code-block:: php - - $request = $client->createRequest('GET', '/'); - $config = $request->getConfig(); - -The config object is a ``GuzzleHttp\Collection`` object that acts like -an associative array. You can grab values from the collection using array like -access. You can also modify and remove values using array like access. - -.. code-block:: php - - $config['foo'] = 'bar'; - echo $config['foo']; - // bar - - var_export(isset($config['foo'])); - // true - - unset($config['foo']); - var_export(isset($config['foo'])); - // false - - var_export($config['foo']); - // NULL - -HTTP handlers and event listeners can expose additional customization options -through request config settings. For example, in order to specify custom cURL -options to the cURL handler, you need to specify an associative array in the -``curl`` ``config`` request option. - -.. code-block:: php - - $client->get('/', [ - 'config' => [ - 'curl' => [ - CURLOPT_HTTPAUTH => CURLAUTH_NTLM, - CURLOPT_USERPWD => 'username:password' - ] - ] - ]); - -Consult the HTTP handlers and event listeners you are using to see if they -allow customization through request configuration options. - -Event Emitter -------------- - -Request objects implement ``GuzzleHttp\Event\HasEmitterInterface``, so they -have a method called ``getEmitter()`` that can be used to get an event emitter -used by the request. Any listener or subscriber attached to a request will only -be triggered for the lifecycle events of a specific request. Conversely, adding -an event listener or subscriber to a client will listen to all lifecycle events -of all requests created by the client. - -See :doc:`events` for more information. - -Responses -========= - -Responses are the HTTP messages a client receives from a server after sending -an HTTP request message. - -Start-Line ----------- - -The start-line of a response contains the protocol and protocol version, -status code, and reason phrase. - -.. code-block:: php - - $response = GuzzleHttp\get('http://httpbin.org/get'); - echo $response->getStatusCode(); - // 200 - echo $response->getReasonPhrase(); - // OK - echo $response->getProtocolVersion(); - // 1.1 - -Body ----- - -As described earlier, you can get the body of a response using the -``getBody()`` method. - -.. code-block:: php - - if ($body = $response->getBody()) { - echo $body; - // Cast to a string: { ... } - $body->seek(0); - // Rewind the body - $body->read(1024); - // Read bytes of the body - } - -When working with JSON responses, you can use the ``json()`` method of a -response: - -.. code-block:: php - - $json = $response->json(); - -.. note:: - - Guzzle uses the ``json_decode()`` method of PHP and uses arrays rather than - ``stdClass`` objects for objects. - -You can use the ``xml()`` method when working with XML data. - -.. code-block:: php - - $xml = $response->xml(); - -.. note:: - - Guzzle uses the ``SimpleXMLElement`` objects when converting response - bodies to XML. - -Effective URL -------------- - -The URL that was ultimately accessed that returned a response can be accessed -using the ``getEffectiveUrl()`` method of a response. This method will return -the URL of a request or the URL of the last redirected URL if any redirects -occurred while transferring a request. - -.. code-block:: php - - $response = GuzzleHttp\get('http://httpbin.org/get'); - echo $response->getEffectiveUrl(); - // http://httpbin.org/get - - $response = GuzzleHttp\get('http://httpbin.org/redirect-to?url=http://www.google.com'); - echo $response->getEffectiveUrl(); - // http://www.google.com diff --git a/vendor/guzzlehttp/guzzle/docs/index.rst b/vendor/guzzlehttp/guzzle/docs/index.rst deleted file mode 100644 index d456a5f0..00000000 --- a/vendor/guzzlehttp/guzzle/docs/index.rst +++ /dev/null @@ -1,98 +0,0 @@ -.. title:: Guzzle | PHP HTTP client and framework for consuming RESTful web services - -====== -Guzzle -====== - -Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and -trivial to integrate with web services. - -- Manages things like persistent connections, represents query strings as - collections, simplifies sending streaming POST requests with fields and - files, and abstracts away the underlying HTTP transport layer. -- Can send both synchronous and asynchronous requests using the same interface - without requiring a dependency on a specific event loop. -- Pluggable HTTP handlers allows Guzzle to integrate with any method you choose - for sending HTTP requests over the wire (e.g., cURL, sockets, PHP's stream - wrapper, non-blocking event loops like `React `_, etc.). -- Guzzle makes it so that you no longer need to fool around with cURL options, - stream contexts, or sockets. - -.. code-block:: php - - $client = new GuzzleHttp\Client(); - $response = $client->get('http://guzzlephp.org'); - $res = $client->get('https://api.github.com/user', ['auth' => ['user', 'pass']]); - echo $res->getStatusCode(); - // "200" - echo $res->getHeader('content-type'); - // 'application/json; charset=utf8' - echo $res->getBody(); - // {"type":"User"...' - var_export($res->json()); - // Outputs the JSON decoded data - - // Send an asynchronous request. - $req = $client->createRequest('GET', 'http://httpbin.org', ['future' => true]); - $client->send($req)->then(function ($response) { - echo 'I completed! ' . $response; - }); - -User guide ----------- - -.. toctree:: - :maxdepth: 2 - - overview - quickstart - clients - http-messages - events - streams - handlers - testing - faq - -HTTP Components ---------------- - -There are a number of optional libraries you can use along with Guzzle's HTTP -layer to add capabilities to the client. - -`Log Subscriber `_ - Logs HTTP requests and responses sent over the wire using customizable - log message templates. - -`OAuth Subscriber `_ - Signs requests using OAuth 1.0. - -`Cache Subscriber `_ - Implements a private transparent proxy cache that caches HTTP responses. - -`Retry Subscriber `_ - Retries failed requests using customizable retry strategies (e.g., retry - based on response status code, cURL error codes, etc.) - -`Message Integrity Subscriber `_ - Verifies the message integrity of HTTP responses using customizable - validators. This plugin can be used, for example, to verify the Content-MD5 - headers of responses. - -Service Description Commands ----------------------------- - -You can use the **Guzzle Command** library to encapsulate interaction with a -web service using command objects. Building on top of Guzzle's command -abstraction allows you to easily implement things like service description that -can be used to serialize requests and parse responses using a meta-description -of a web service. - -`Guzzle Command `_ - Provides the foundational elements used to build high-level, command based, - web service clients with Guzzle. - -`Guzzle Services `_ - Provides an implementation of the *Guzzle Command* library that uses - Guzzle service descriptions to describe web services, serialize requests, - and parse responses into easy to use model structures. diff --git a/vendor/guzzlehttp/guzzle/docs/overview.rst b/vendor/guzzlehttp/guzzle/docs/overview.rst deleted file mode 100644 index 1355afa1..00000000 --- a/vendor/guzzlehttp/guzzle/docs/overview.rst +++ /dev/null @@ -1,150 +0,0 @@ -======== -Overview -======== - -Requirements -============ - -#. PHP 5.4.0 -#. To use the PHP stream handler, ``allow_url_fopen`` must be enabled in your - system's php.ini. -#. To use the cURL handler, you must have a recent version of cURL >= 7.16.2 - compiled with OpenSSL and zlib. - -.. note:: - - Guzzle no longer requires cURL in order to send HTTP requests. Guzzle will - use the PHP stream wrapper to send HTTP requests if cURL is not installed. - Alternatively, you can provide your own HTTP handler used to send requests. - -.. _installation: - -Installation -============ - -The recommended way to install Guzzle is with `Composer `_. Composer is a dependency -management tool for PHP that allows you to declare the dependencies your project needs and installs them into your -project. - -.. code-block:: bash - - # Install Composer - curl -sS https://getcomposer.org/installer | php - -You can add Guzzle as a dependency using the composer.phar CLI: - -.. code-block:: bash - - php composer.phar require guzzlehttp/guzzle:~5.0 - -Alternatively, you can specify Guzzle as a dependency in your project's -existing composer.json file: - -.. code-block:: js - - { - "require": { - "guzzlehttp/guzzle": "~5.0" - } - } - -After installing, you need to require Composer's autoloader: - -.. code-block:: php - - require 'vendor/autoload.php'; - -You can find out more on how to install Composer, configure autoloading, and -other best-practices for defining dependencies at `getcomposer.org `_. - -Bleeding edge -------------- - -During your development, you can keep up with the latest changes on the master -branch by setting the version requirement for Guzzle to ``~5.0@dev``. - -.. code-block:: js - - { - "require": { - "guzzlehttp/guzzle": "~5.0@dev" - } - } - -License -======= - -Licensed using the `MIT license `_. - - Copyright (c) 2014 Michael Dowling - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -Contributing -============ - -Guidelines ----------- - -1. Guzzle follows PSR-0, PSR-1, and PSR-2. -2. Guzzle is meant to be lean and fast with very few dependencies. -3. Guzzle has a minimum PHP version requirement of PHP 5.4. Pull requests must - not require a PHP version greater than PHP 5.4. -4. All pull requests must include unit tests to ensure the change works as - expected and to prevent regressions. - -Running the tests ------------------ - -In order to contribute, you'll need to checkout the source from GitHub and -install Guzzle's dependencies using Composer: - -.. code-block:: bash - - git clone https://github.com/guzzle/guzzle.git - cd guzzle && curl -s http://getcomposer.org/installer | php && ./composer.phar install --dev - -Guzzle is unit tested with PHPUnit. Run the tests using the vendored PHPUnit -binary: - -.. code-block:: bash - - vendor/bin/phpunit - -.. note:: - - You'll need to install node.js v0.5.0 or newer in order to perform - integration tests on Guzzle's HTTP handlers. - -Reporting a security vulnerability -================================== - -We want to ensure that Guzzle is a secure HTTP client library for everyone. If -you've discovered a security vulnerability in Guzzle, we appreciate your help -in disclosing it to us in a `responsible manner `_. - -Publicly disclosing a vulnerability can put the entire community at risk. If -you've discovered a security concern, please email us at -security@guzzlephp.org. We'll work with you to make sure that we understand the -scope of the issue, and that we fully address your concern. We consider -correspondence sent to security@guzzlephp.org our highest priority, and work to -address any issues that arise as quickly as possible. - -After a security vulnerability has been corrected, a security hotfix release will -be deployed as soon as possible. diff --git a/vendor/guzzlehttp/guzzle/docs/quickstart.rst b/vendor/guzzlehttp/guzzle/docs/quickstart.rst deleted file mode 100644 index 65a70ed2..00000000 --- a/vendor/guzzlehttp/guzzle/docs/quickstart.rst +++ /dev/null @@ -1,448 +0,0 @@ -========== -Quickstart -========== - -This page provides a quick introduction to Guzzle and introductory examples. -If you have not already installed, Guzzle, head over to the :ref:`installation` -page. - -Make a Request -============== - -You can send requests with Guzzle using a ``GuzzleHttp\ClientInterface`` -object. - -Creating a Client ------------------ - -The procedural API is simple but not very testable; it's best left for quick -prototyping. If you want to use Guzzle in a more flexible and testable way, -then you'll need to use a ``GuzzleHttp\ClientInterface`` object. - -.. code-block:: php - - use GuzzleHttp\Client; - - $client = new Client(); - $response = $client->get('http://httpbin.org/get'); - - // You can use the same methods you saw in the procedural API - $response = $client->delete('http://httpbin.org/delete'); - $response = $client->head('http://httpbin.org/get'); - $response = $client->options('http://httpbin.org/get'); - $response = $client->patch('http://httpbin.org/patch'); - $response = $client->post('http://httpbin.org/post'); - $response = $client->put('http://httpbin.org/put'); - -You can create a request with a client and then send the request with the -client when you're ready. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://www.foo.com'); - $response = $client->send($request); - -Client objects provide a great deal of flexibility in how request are -transferred including default request options, subscribers that are attached -to each request, and a base URL that allows you to send requests with relative -URLs. You can find out all about clients in the :doc:`clients` page of the -documentation. - -Using Responses -=============== - -In the previous examples, we retrieved a ``$response`` variable. This value is -actually a ``GuzzleHttp\Message\ResponseInterface`` object and contains lots -of helpful information. - -You can get the status code and reason phrase of the response. - -.. code-block:: php - - $code = $response->getStatusCode(); - // 200 - - $reason = $response->getReasonPhrase(); - // OK - -By providing the ``future`` request option to a request, you can send requests -asynchronously using the promise interface of a future response. - -.. code-block:: php - - $client->get('http://httpbin.org', ['future' => true]) - ->then(function ($response) { - echo $response->getStatusCode(); - }); - -Response Body -------------- - -The body of a response can be retrieved and cast to a string. - -.. code-block:: php - - $body = $response->getBody(); - echo $body; - // { "some_json_data" ...} - -You can also read read bytes from body of a response like a stream. - -.. code-block:: php - - $body = $response->getBody(); - - while (!$body->eof()) { - echo $body->read(1024); - } - -JSON Responses -~~~~~~~~~~~~~~ - -You can more easily work with JSON responses using the ``json()`` method of a -response. - -.. code-block:: php - - $response = $client->get('http://httpbin.org/get'); - $json = $response->json(); - var_dump($json[0]['origin']); - -Guzzle internally uses PHP's ``json_decode()`` function to parse responses. If -Guzzle is unable to parse the JSON response body, then a -``GuzzleHttp\Exception\ParseException`` is thrown. - -XML Responses -~~~~~~~~~~~~~ - -You can use a response's ``xml()`` method to more easily work with responses -that contain XML data. - -.. code-block:: php - - $response = $client->get('https://github.com/mtdowling.atom'); - $xml = $response->xml(); - echo $xml->id; - // tag:github.com,2008:/mtdowling - -Guzzle internally uses a ``SimpleXMLElement`` object to parse responses. If -Guzzle is unable to parse the XML response body, then a -``GuzzleHttp\Exception\ParseException`` is thrown. - -Query String Parameters -======================= - -Sending query string parameters with a request is easy. You can set query -string parameters in the request's URL. - -.. code-block:: php - - $response = $client->get('http://httpbin.org?foo=bar'); - -You can also specify the query string parameters using the ``query`` request -option. - -.. code-block:: php - - $client->get('http://httpbin.org', [ - 'query' => ['foo' => 'bar'] - ]); - -And finally, you can build up the query string of a request as needed by -calling the ``getQuery()`` method of a request and modifying the request's -``GuzzleHttp\Query`` object as needed. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httpbin.org'); - $query = $request->getQuery(); - $query->set('foo', 'bar'); - - // You can use the query string object like an array - $query['baz'] = 'bam'; - - // The query object can be cast to a string - echo $query; - // foo=bar&baz=bam - - // Setting a value to false or null will cause the "=" sign to be omitted - $query['empty'] = null; - echo $query; - // foo=bar&baz=bam&empty - - // Use an empty string to include the "=" sign with an empty value - $query['empty'] = ''; - echo $query; - // foo=bar&baz=bam&empty= - -.. _headers: - -Request and Response Headers ----------------------------- - -You can specify request headers when sending or creating requests with a -client. In the following example, we send the ``X-Foo-Header`` with a value of -``value`` by setting the ``headers`` request option. - -.. code-block:: php - - $response = $client->get('http://httpbin.org/get', [ - 'headers' => ['X-Foo-Header' => 'value'] - ]); - -You can view the headers of a response using header specific methods of a -response class. Headers work exactly the same way for request and response -object. - -You can retrieve a header from a request or response using the ``getHeader()`` -method of the object. This method is case-insensitive and by default will -return a string containing the header field value. - -.. code-block:: php - - $response = $client->get('http://www.yahoo.com'); - $length = $response->getHeader('Content-Length'); - -Header fields that contain multiple values can be retrieved as a string or as -an array. Retrieving the field values as a string will naively concatenate all -of the header values together with a comma. Because not all header fields -should be represented this way (e.g., ``Set-Cookie``), you can pass an optional -flag to the ``getHeader()`` method to retrieve the header values as an array. - -.. code-block:: php - - $values = $response->getHeader('Set-Cookie', true); - foreach ($values as $value) { - echo $value; - } - -You can test if a request or response has a specific header using the -``hasHeader()`` method. This method accepts a case-insensitive string and -returns true if the header is present or false if it is not. - -You can retrieve all of the headers of a message using the ``getHeaders()`` -method of a request or response. The return value is an associative array where -the keys represent the header name as it will be sent over the wire, and each -value is an array of strings associated with the header. - -.. code-block:: php - - $headers = $response->getHeaders(); - foreach ($message->getHeaders() as $name => $values) { - echo $name . ": " . implode(", ", $values); - } - -Modifying headers ------------------ - -The headers of a message can be modified using the ``setHeader()``, -``addHeader()``, ``setHeaders()``, and ``removeHeader()`` methods of a request -or response object. - -.. code-block:: php - - $request = $client->createRequest('GET', 'http://httpbin.org/get'); - - // Set a single value for a header - $request->setHeader('User-Agent', 'Testing!'); - - // Set multiple values for a header in one call - $request->setHeader('X-Foo', ['Baz', 'Bar']); - - // Add a header to the message - $request->addHeader('X-Foo', 'Bam'); - - echo $request->getHeader('X-Foo'); - // Baz, Bar, Bam - - // Remove a specific header using a case-insensitive name - $request->removeHeader('x-foo'); - echo $request->getHeader('X-Foo'); - // Echoes an empty string: '' - -Uploading Data -============== - -Guzzle provides several methods of uploading data. - -You can send requests that contain a stream of data by passing a string, -resource returned from ``fopen``, or a ``GuzzleHttp\Stream\StreamInterface`` -object to the ``body`` request option. - -.. code-block:: php - - $r = $client->post('http://httpbin.org/post', ['body' => 'raw data']); - -You can easily upload JSON data using the ``json`` request option. - -.. code-block:: php - - $r = $client->put('http://httpbin.org/put', ['json' => ['foo' => 'bar']]); - -POST Requests -------------- - -In addition to specifying the raw data of a request using the ``body`` request -option, Guzzle provides helpful abstractions over sending POST data. - -Sending POST Fields -~~~~~~~~~~~~~~~~~~~ - -Sending ``application/x-www-form-urlencoded`` POST requests requires that you -specify the body of a POST request as an array. - -.. code-block:: php - - $response = $client->post('http://httpbin.org/post', [ - 'body' => [ - 'field_name' => 'abc', - 'other_field' => '123' - ] - ]); - -You can also build up POST requests before sending them. - -.. code-block:: php - - $request = $client->createRequest('POST', 'http://httpbin.org/post'); - $postBody = $request->getBody(); - - // $postBody is an instance of GuzzleHttp\Post\PostBodyInterface - $postBody->setField('foo', 'bar'); - echo $postBody->getField('foo'); - // 'bar' - - echo json_encode($postBody->getFields()); - // {"foo": "bar"} - - // Send the POST request - $response = $client->send($request); - -Sending POST Files -~~~~~~~~~~~~~~~~~~ - -Sending ``multipart/form-data`` POST requests (POST requests that contain -files) is the same as sending ``application/x-www-form-urlencoded``, except -some of the array values of the POST fields map to PHP ``fopen`` resources, or -``GuzzleHttp\Stream\StreamInterface``, or -``GuzzleHttp\Post\PostFileInterface`` objects. - -.. code-block:: php - - use GuzzleHttp\Post\PostFile; - - $response = $client->post('http://httpbin.org/post', [ - 'body' => [ - 'field_name' => 'abc', - 'file_filed' => fopen('/path/to/file', 'r'), - 'other_file' => new PostFile('other_file', 'this is the content') - ] - ]); - -Just like when sending POST fields, you can also build up POST requests with -files before sending them. - -.. code-block:: php - - use GuzzleHttp\Post\PostFile; - - $request = $client->createRequest('POST', 'http://httpbin.org/post'); - $postBody = $request->getBody(); - $postBody->setField('foo', 'bar'); - $postBody->addFile(new PostFile('test', fopen('/path/to/file', 'r'))); - $response = $client->send($request); - -Cookies -======= - -Guzzle can maintain a cookie session for you if instructed using the -``cookies`` request option. - -- Set to ``true`` to use a shared cookie session associated with the client. -- Pass an associative array containing cookies to send in the request and start - a new cookie session. -- Set to a ``GuzzleHttp\Subscriber\CookieJar\CookieJarInterface`` object to use - an existing cookie jar. - -Redirects -========= - -Guzzle will automatically follow redirects unless you tell it not to. You can -customize the redirect behavior using the ``allow_redirects`` request option. - -- Set to true to enable normal redirects with a maximum number of 5 redirects. - This is the default setting. -- Set to false to disable redirects. -- Pass an associative array containing the 'max' key to specify the maximum - number of redirects and optionally provide a 'strict' key value to specify - whether or not to use strict RFC compliant redirects (meaning redirect POST - requests with POST requests vs. doing what most browsers do which is - redirect POST requests with GET requests). - -.. code-block:: php - - $response = $client->get('http://github.com'); - echo $response->getStatusCode(); - // 200 - echo $response->getEffectiveUrl(); - // 'https://github.com/' - -The following example shows that redirects can be disabled. - -.. code-block:: php - - $response = $client->get('http://github.com', ['allow_redirects' => false]); - echo $response->getStatusCode(); - // 301 - echo $response->getEffectiveUrl(); - // 'http://github.com/' - -Exceptions -========== - -Guzzle throws exceptions for errors that occur during a transfer. - -- In the event of a networking error (connection timeout, DNS errors, etc.), - a ``GuzzleHttp\Exception\RequestException`` is thrown. This exception - extends from ``GuzzleHttp\Exception\TransferException``. Catching this - exception will catch any exception that can be thrown while transferring - (non-parallel) requests. - - .. code-block:: php - - use GuzzleHttp\Exception\RequestException; - - try { - $client->get('https://github.com/_abc_123_404'); - } catch (RequestException $e) { - echo $e->getRequest(); - if ($e->hasResponse()) { - echo $e->getResponse(); - } - } - -- A ``GuzzleHttp\Exception\ClientException`` is thrown for 400 - level errors if the ``exceptions`` request option is set to true. This - exception extends from ``GuzzleHttp\Exception\BadResponseException`` and - ``GuzzleHttp\Exception\BadResponseException`` extends from - ``GuzzleHttp\Exception\RequestException``. - - .. code-block:: php - - use GuzzleHttp\Exception\ClientException; - - try { - $client->get('https://github.com/_abc_123_404'); - } catch (ClientException $e) { - echo $e->getRequest(); - echo $e->getResponse(); - } - -- A ``GuzzleHttp\Exception\ServerException`` is thrown for 500 level - errors if the ``exceptions`` request option is set to true. This - exception extends from ``GuzzleHttp\Exception\BadResponseException``. -- A ``GuzzleHttp\Exception\TooManyRedirectsException`` is thrown when too - many redirects are followed. This exception extends from ``GuzzleHttp\Exception\RequestException``. - -All of the above exceptions extend from -``GuzzleHttp\Exception\TransferException``. diff --git a/vendor/guzzlehttp/guzzle/docs/requirements.txt b/vendor/guzzlehttp/guzzle/docs/requirements.txt deleted file mode 100644 index fe7a4eab..00000000 --- a/vendor/guzzlehttp/guzzle/docs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -Sphinx>=1.2b1 -guzzle_sphinx_theme>=0.6.0 diff --git a/vendor/guzzlehttp/guzzle/docs/streams.rst b/vendor/guzzlehttp/guzzle/docs/streams.rst deleted file mode 100644 index 8fe9a698..00000000 --- a/vendor/guzzlehttp/guzzle/docs/streams.rst +++ /dev/null @@ -1,213 +0,0 @@ -======= -Streams -======= - -Guzzle uses stream objects to represent request and response message bodies. -These stream objects allow you to work with various types of data all using a -common interface. - -HTTP messages consist of a start-line, headers, and a body. The body of an HTTP -message can be very small or extremely large. Attempting to represent the body -of a message as a string can easily consume more memory than intended because -the body must be stored completely in memory. Attempting to store the body of a -request or response in memory would preclude the use of that implementation from -being able to work with large message bodies. The StreamInterface is used in -order to hide the implementation details of where a stream of data is read from -or written to. - -Guzzle's StreamInterface exposes several methods that enable streams to be read -from, written to, and traversed effectively. - -Streams expose their capabilities using three methods: ``isReadable()``, -``isWritable()``, and ``isSeekable()``. These methods can be used by stream -collaborators to determine if a stream is capable of their requirements. - -Each stream instance has various capabilities: they can be read-only, -write-only, read-write, allow arbitrary random access (seeking forwards or -backwards to any location), or only allow sequential access (for example in the -case of a socket or pipe). - -Creating Streams -================ - -The best way to create a stream is using the static factory method, -``GuzzleHttp\Stream\Stream::factory()``. This factory accepts strings, -resources returned from ``fopen()``, an object that implements -``__toString()``, and an object that implements -``GuzzleHttp\Stream\StreamInterface``. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - - $stream = Stream::factory('string data'); - echo $stream; - // string data - echo $stream->read(3); - // str - echo $stream->getContents(); - // ing data - var_export($stream->eof()); - // true - var_export($stream->tell()); - // 11 - -Metadata -======== - -Guzzle streams expose stream metadata through the ``getMetadata()`` method. -This method provides the data you would retrieve when calling PHP's -`stream_get_meta_data() function `_, -and can optionally expose other custom data. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - - $resource = fopen('/path/to/file', 'r'); - $stream = Stream::factory($resource); - echo $stream->getMetadata('uri'); - // /path/to/file - var_export($stream->isReadable()); - // true - var_export($stream->isWritable()); - // false - var_export($stream->isSeekable()); - // true - -Stream Decorators -================= - -With the small and focused interface, add custom functionality to streams is -very simple with stream decorators. Guzzle provides several built-in decorators -that provide additional stream functionality. - -CachingStream -------------- - -The CachingStream is used to allow seeking over previously read bytes on -non-seekable streams. This can be useful when transferring a non-seekable -entity body fails due to needing to rewind the stream (for example, resulting -from a redirect). Data that is read from the remote stream will be buffered in -a PHP temp stream so that previously read bytes are cached first in memory, -then on disk. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - use GuzzleHttp\Stream\CachingStream; - - $original = Stream::factory(fopen('http://www.google.com', 'r')); - $stream = new CachingStream($original); - - $stream->read(1024); - echo $stream->tell(); - // 1024 - - $stream->seek(0); - echo $stream->tell(); - // 0 - -LimitStream ------------ - -LimitStream can be used to read a subset or slice of an existing stream object. -This can be useful for breaking a large file into smaller pieces to be sent in -chunks (e.g. Amazon S3's multipart upload API). - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - use GuzzleHttp\Stream\LimitStream; - - $original = Stream::factory(fopen('/tmp/test.txt', 'r+')); - echo $original->getSize(); - // >>> 1048576 - - // Limit the size of the body to 1024 bytes and start reading from byte 2048 - $stream = new LimitStream($original, 1024, 2048); - echo $stream->getSize(); - // >>> 1024 - echo $stream->tell(); - // >>> 0 - -NoSeekStream ------------- - -NoSeekStream wraps a stream and does not allow seeking. - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - use GuzzleHttp\Stream\LimitStream; - - $original = Stream::factory('foo'); - $noSeek = new NoSeekStream($original); - - echo $noSeek->read(3); - // foo - var_export($noSeek->isSeekable()); - // false - $noSeek->seek(0); - var_export($noSeek->read(3)); - // NULL - -Creating Custom Decorators --------------------------- - -Creating a stream decorator is very easy thanks to the -``GuzzleHttp\Stream\StreamDecoratorTrait``. This trait provides methods that -implement ``GuzzleHttp\Stream\StreamInterface`` by proxying to an underlying -stream. Just ``use`` the ``StreamDecoratorTrait`` and implement your custom -methods. - -For example, let's say we wanted to call a specific function each time the last -byte is read from a stream. This could be implemented by overriding the -``read()`` method. - -.. code-block:: php - - use GuzzleHttp\Stream\StreamDecoratorTrait; - - class EofCallbackStream implements StreamInterface - { - use StreamDecoratorTrait; - - private $callback; - - public function __construct(StreamInterface $stream, callable $callback) - { - $this->stream = $stream; - $this->callback = $callback; - } - - public function read($length) - { - $result = $this->stream->read($length); - - // Invoke the callback when EOF is hit. - if ($this->eof()) { - call_user_func($this->callback); - } - - return $result; - } - } - -This decorator could be added to any existing stream and used like so: - -.. code-block:: php - - use GuzzleHttp\Stream\Stream; - - $original = Stream::factory('foo'); - $eofStream = new EofCallbackStream($original, function () { - echo 'EOF!'; - }); - - $eofStream->read(2); - $eofStream->read(1); - // echoes "EOF!" - $eofStream->seek(0); - $eofStream->read(3); - // echoes "EOF!" diff --git a/vendor/guzzlehttp/guzzle/docs/testing.rst b/vendor/guzzlehttp/guzzle/docs/testing.rst deleted file mode 100644 index 03bcc2ee..00000000 --- a/vendor/guzzlehttp/guzzle/docs/testing.rst +++ /dev/null @@ -1,232 +0,0 @@ -====================== -Testing Guzzle Clients -====================== - -Guzzle provides several tools that will enable you to easily mock the HTTP -layer without needing to send requests over the internet. - -* Mock subscriber -* Mock handler -* Node.js web server for integration testing - -Mock Subscriber -=============== - -When testing HTTP clients, you often need to simulate specific scenarios like -returning a successful response, returning an error, or returning specific -responses in a certain order. Because unit tests need to be predictable, easy -to bootstrap, and fast, hitting an actual remote API is a test smell. - -Guzzle provides a mock subscriber that can be attached to clients or requests -that allows you to queue up a list of responses to use rather than hitting a -remote API. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Subscriber\Mock; - use GuzzleHttp\Message\Response; - - $client = new Client(); - - // Create a mock subscriber and queue two responses. - $mock = new Mock([ - new Response(200, ['X-Foo' => 'Bar']), // Use response object - "HTTP/1.1 202 OK\r\nContent-Length: 0\r\n\r\n" // Use a response string - ]); - - // Add the mock subscriber to the client. - $client->getEmitter()->attach($mock); - // The first request is intercepted with the first response. - echo $client->get('/')->getStatusCode(); - //> 200 - // The second request is intercepted with the second response. - echo $client->get('/')->getStatusCode(); - //> 202 - -When no more responses are in the queue and a request is sent, an -``OutOfBoundsException`` is thrown. - -History Subscriber -================== - -When using things like the ``Mock`` subscriber, you often need to know if the -requests you expected to send were sent exactly as you intended. While the mock -subscriber responds with mocked responses, the ``GuzzleHttp\Subscriber\History`` -subscriber maintains a history of the requests that were sent by a client. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Subscriber\History; - - $client = new Client(); - $history = new History(); - - // Add the history subscriber to the client. - $client->getEmitter()->attach($history); - - $client->get('http://httpbin.org/get'); - $client->head('http://httpbin.org/get'); - - // Count the number of transactions - echo count($history); - //> 2 - // Get the last request - $lastRequest = $history->getLastRequest(); - // Get the last response - $lastResponse = $history->getLastResponse(); - - // Iterate over the transactions that were sent - foreach ($history as $transaction) { - echo $transaction['request']->getMethod(); - //> GET, HEAD - echo $transaction['response']->getStatusCode(); - //> 200, 200 - } - -The history subscriber can also be printed, revealing the requests and -responses that were sent as a string, in order. - -.. code-block:: php - - echo $history; - -:: - - > GET /get HTTP/1.1 - Host: httpbin.org - User-Agent: Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8 - - < HTTP/1.1 200 OK - Access-Control-Allow-Origin: * - Content-Type: application/json - Date: Tue, 25 Mar 2014 03:53:27 GMT - Server: gunicorn/0.17.4 - Content-Length: 270 - Connection: keep-alive - - { - "headers": { - "Connection": "close", - "X-Request-Id": "3d0f7d5c-c937-4394-8248-2b8e03fcccdb", - "User-Agent": "Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8", - "Host": "httpbin.org" - }, - "origin": "76.104.247.1", - "args": {}, - "url": "http://httpbin.org/get" - } - - > HEAD /get HTTP/1.1 - Host: httpbin.org - User-Agent: Guzzle/4.0-dev curl/7.21.4 PHP/5.5.8 - - < HTTP/1.1 200 OK - Access-Control-Allow-Origin: * - Content-length: 270 - Content-Type: application/json - Date: Tue, 25 Mar 2014 03:53:27 GMT - Server: gunicorn/0.17.4 - Connection: keep-alive - -Mock Adapter -============ - -In addition to using the Mock subscriber, you can use the -``GuzzleHttp\Ring\Client\MockHandler`` as the handler of a client to return the -same response over and over or return the result of a callable function. - -Test Web Server -=============== - -Using mock responses is almost always enough when testing a web service client. -When implementing custom :doc:`HTTP handlers `, you'll need to send -actual HTTP requests in order to sufficiently test the handler. However, a -best practice is to contact a local web server rather than a server over the -internet. - -- Tests are more reliable -- Tests do not require a network connection -- Tests have no external dependencies - -Using the test server ---------------------- - -.. warning:: - - The following functionality is provided to help developers of Guzzle - develop HTTP handlers. There is no promise of backwards compatibility - when it comes to the node.js test server or the ``GuzzleHttp\Tests\Server`` - class. If you are using the test server or ``Server`` class outside of - guzzlehttp/guzzle, then you will need to configure autoloading and - ensure the web server is started manually. - -.. hint:: - - You almost never need to use this test web server. You should only ever - consider using it when developing HTTP handlers. The test web server - is not necessary for mocking requests. For that, please use the - Mock subcribers and History subscriber. - -Guzzle ships with a node.js test server that receives requests and returns -responses from a queue. The test server exposes a simple API that is used to -enqueue responses and inspect the requests that it has received. - -Any operation on the ``Server`` object will ensure that -the server is running and wait until it is able to receive requests before -returning. - -.. code-block:: php - - use GuzzleHttp\Client; - use GuzzleHttp\Tests\Server; - - // Start the server and queue a response - Server::enqueue("HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n"); - - $client = new Client(['base_url' => Server::$url]); - echo $client->get('/foo')->getStatusCode(); - // 200 - -``GuzzleHttp\Tests\Server`` provides a static interface to the test server. You -can queue an HTTP response or an array of responses by calling -``Server::enqueue()``. This method accepts a string representing an HTTP -response message, a ``GuzzleHttp\Message\ResponseInterface``, or an array of -HTTP message strings / ``GuzzleHttp\Message\ResponseInterface`` objects. - -.. code-block:: php - - // Queue single response - Server::enqueue("HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n"); - - // Clear the queue and queue an array of responses - Server::enqueue([ - "HTTP/1.1 200 OK\r\n\Content-Length: 0r\n\r\n", - "HTTP/1.1 404 Not Found\r\n\Content-Length: 0r\n\r\n" - ]); - -When a response is queued on the test server, the test server will remove any -previously queued responses. As the server receives requests, queued responses -are dequeued and returned to the request. When the queue is empty, the server -will return a 500 response. - -You can inspect the requests that the server has retrieved by calling -``Server::received()``. This method accepts an optional ``$hydrate`` parameter -that specifies if you are retrieving an array of HTTP requests as strings or an -array of ``GuzzleHttp\Message\RequestInterface`` objects. - -.. code-block:: php - - foreach (Server::received() as $response) { - echo $response; - } - -You can clear the list of received requests from the web server using the -``Server::flush()`` method. - -.. code-block:: php - - Server::flush(); - echo count(Server::received()); - // 0 diff --git a/vendor/guzzlehttp/guzzle/phpunit.xml.dist b/vendor/guzzlehttp/guzzle/phpunit.xml.dist deleted file mode 100644 index 500cd53a..00000000 --- a/vendor/guzzlehttp/guzzle/phpunit.xml.dist +++ /dev/null @@ -1,17 +0,0 @@ - - - - - tests - - - - - src - - src/ - - - - diff --git a/vendor/guzzlehttp/guzzle/src/Client.php b/vendor/guzzlehttp/guzzle/src/Client.php index b5ed11ff..fa1038da 100644 --- a/vendor/guzzlehttp/guzzle/src/Client.php +++ b/vendor/guzzlehttp/guzzle/src/Client.php @@ -199,9 +199,12 @@ protected function getDefaultOptions() 'verify' => true ]; - // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set - if ($proxy = getenv('HTTP_PROXY')) { - $settings['proxy']['http'] = $proxy; + // Use the standard Linux HTTP_PROXY and HTTPS_PROXY if set. + // We can only trust the HTTP_PROXY environment variable in a CLI + // process due to the fact that PHP has no reliable mechanism to + // get environment variables that start with "HTTP_". + if (php_sapi_name() == 'cli' && getenv('HTTP_PROXY')) { + $settings['proxy']['http'] = getenv('HTTP_PROXY'); } if ($proxy = getenv('HTTPS_PROXY')) { diff --git a/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/vendor/guzzlehttp/guzzle/src/ClientInterface.php index 63f0174d..6668597d 100644 --- a/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ b/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -11,7 +11,7 @@ */ interface ClientInterface extends HasEmitterInterface { - const VERSION = '5.3.0'; + const VERSION = '5.3.1'; /** * Create and return a new {@see RequestInterface} object. diff --git a/vendor/guzzlehttp/guzzle/src/Event/Emitter.php b/vendor/guzzlehttp/guzzle/src/Event/Emitter.php index 4e44f45e..d034fdae 100644 --- a/vendor/guzzlehttp/guzzle/src/Event/Emitter.php +++ b/vendor/guzzlehttp/guzzle/src/Event/Emitter.php @@ -43,8 +43,7 @@ public function on($eventName, callable $listener, $priority = 0) public function once($eventName, callable $listener, $priority = 0) { $onceListener = function ( - EventInterface $event, - $eventName + EventInterface $event ) use (&$onceListener, $eventName, $listener, $priority) { $this->removeListener($eventName, $onceListener); $listener($event, $eventName); diff --git a/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php b/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php index 0c675758..f118e0fe 100644 --- a/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php +++ b/vendor/guzzlehttp/guzzle/src/Message/AbstractMessage.php @@ -107,7 +107,7 @@ public function setHeaders(array $headers) { $this->headers = $this->headerNames = []; foreach ($headers as $key => $value) { - $this->setHeader($key, $value); + $this->addHeader($key, $value); } } diff --git a/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php b/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php index 85984e2d..d469ef1e 100644 --- a/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php +++ b/vendor/guzzlehttp/guzzle/src/Message/MessageFactory.php @@ -87,7 +87,7 @@ public function createRequest($method, $url, array $options = []) unset($options['config']); // Use a POST body by default - if ($method == 'POST' + if (strtoupper($method) == 'POST' && !isset($options['body']) && !isset($options['json']) ) { diff --git a/vendor/guzzlehttp/guzzle/tests/BatchResultsTest.php b/vendor/guzzlehttp/guzzle/tests/BatchResultsTest.php deleted file mode 100644 index 080d44c0..00000000 --- a/vendor/guzzlehttp/guzzle/tests/BatchResultsTest.php +++ /dev/null @@ -1,58 +0,0 @@ -assertCount(3, $batch); - $this->assertEquals([$a, $b, $c], $batch->getKeys()); - $this->assertEquals([$hash[$c]], $batch->getFailures()); - $this->assertEquals(['1', '2'], $batch->getSuccessful()); - $this->assertEquals('1', $batch->getResult($a)); - $this->assertNull($batch->getResult(new \stdClass())); - $this->assertTrue(isset($batch[0])); - $this->assertFalse(isset($batch[10])); - $this->assertEquals('1', $batch[0]); - $this->assertEquals('2', $batch[1]); - $this->assertNull($batch[100]); - $this->assertInstanceOf('Exception', $batch[2]); - - $results = iterator_to_array($batch); - $this->assertEquals(['1', '2', $hash[$c]], $results); - } - - /** - * @expectedException \RuntimeException - */ - public function testCannotSetByIndex() - { - $hash = new \SplObjectStorage(); - $batch = new BatchResults($hash); - $batch[10] = 'foo'; - } - - /** - * @expectedException \RuntimeException - */ - public function testCannotUnsetByIndex() - { - $hash = new \SplObjectStorage(); - $batch = new BatchResults($hash); - unset($batch[10]); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/ClientTest.php b/vendor/guzzlehttp/guzzle/tests/ClientTest.php deleted file mode 100644 index 02db3eb9..00000000 --- a/vendor/guzzlehttp/guzzle/tests/ClientTest.php +++ /dev/null @@ -1,647 +0,0 @@ -ma = function () { - throw new \RuntimeException('Should not have been called.'); - }; - } - - public function testUsesDefaultDefaultOptions() - { - $client = new Client(); - $this->assertTrue($client->getDefaultOption('allow_redirects')); - $this->assertTrue($client->getDefaultOption('exceptions')); - $this->assertTrue($client->getDefaultOption('verify')); - } - - public function testUsesProvidedDefaultOptions() - { - $client = new Client([ - 'defaults' => [ - 'allow_redirects' => false, - 'query' => ['foo' => 'bar'] - ] - ]); - $this->assertFalse($client->getDefaultOption('allow_redirects')); - $this->assertTrue($client->getDefaultOption('exceptions')); - $this->assertTrue($client->getDefaultOption('verify')); - $this->assertEquals(['foo' => 'bar'], $client->getDefaultOption('query')); - } - - public function testCanSpecifyBaseUrl() - { - $this->assertSame('', (new Client())->getBaseUrl()); - $this->assertEquals('http://foo', (new Client([ - 'base_url' => 'http://foo' - ]))->getBaseUrl()); - } - - public function testCanSpecifyBaseUrlUriTemplate() - { - $client = new Client(['base_url' => ['http://foo.com/{var}/', ['var' => 'baz']]]); - $this->assertEquals('http://foo.com/baz/', $client->getBaseUrl()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesUriTemplateValue() - { - new Client(['base_url' => ['http://foo.com/']]); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Foo - */ - public function testCanSpecifyHandler() - { - $client = new Client(['handler' => function () { - throw new \Exception('Foo'); - }]); - $client->get('http://httpbin.org'); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Foo - */ - public function testCanSpecifyHandlerAsAdapter() - { - $client = new Client(['adapter' => function () { - throw new \Exception('Foo'); - }]); - $client->get('http://httpbin.org'); - } - - /** - * @expectedException \Exception - * @expectedExceptionMessage Foo - */ - public function testCanSpecifyMessageFactory() - { - $factory = $this->getMockBuilder('GuzzleHttp\Message\MessageFactoryInterface') - ->setMethods(['createRequest']) - ->getMockForAbstractClass(); - $factory->expects($this->once()) - ->method('createRequest') - ->will($this->throwException(new \Exception('Foo'))); - $client = new Client(['message_factory' => $factory]); - $client->get(); - } - - public function testCanSpecifyEmitter() - { - $emitter = $this->getMockBuilder('GuzzleHttp\Event\EmitterInterface') - ->setMethods(['listeners']) - ->getMockForAbstractClass(); - $emitter->expects($this->once()) - ->method('listeners') - ->will($this->returnValue('foo')); - - $client = new Client(['emitter' => $emitter]); - $this->assertEquals('foo', $client->getEmitter()->listeners()); - } - - public function testAddsDefaultUserAgentHeaderWithDefaultOptions() - { - $client = new Client(['defaults' => ['allow_redirects' => false]]); - $this->assertFalse($client->getDefaultOption('allow_redirects')); - $this->assertEquals( - ['User-Agent' => Utils::getDefaultUserAgent()], - $client->getDefaultOption('headers') - ); - } - - public function testAddsDefaultUserAgentHeaderWithoutDefaultOptions() - { - $client = new Client(); - $this->assertEquals( - ['User-Agent' => Utils::getDefaultUserAgent()], - $client->getDefaultOption('headers') - ); - } - - private function getRequestClient() - { - $client = $this->getMockBuilder('GuzzleHttp\Client') - ->setMethods(['send']) - ->getMock(); - $client->expects($this->once()) - ->method('send') - ->will($this->returnArgument(0)); - - return $client; - } - - public function requestMethodProvider() - { - return [ - ['GET', false], - ['HEAD', false], - ['DELETE', false], - ['OPTIONS', false], - ['POST', 'foo'], - ['PUT', 'foo'], - ['PATCH', 'foo'] - ]; - } - - /** - * @dataProvider requestMethodProvider - */ - public function testClientProvidesMethodShortcut($method, $body) - { - $client = $this->getRequestClient(); - if ($body) { - $request = $client->{$method}('http://foo.com', [ - 'headers' => ['X-Baz' => 'Bar'], - 'body' => $body, - 'query' => ['a' => 'b'] - ]); - } else { - $request = $client->{$method}('http://foo.com', [ - 'headers' => ['X-Baz' => 'Bar'], - 'query' => ['a' => 'b'] - ]); - } - $this->assertEquals($method, $request->getMethod()); - $this->assertEquals('Bar', $request->getHeader('X-Baz')); - $this->assertEquals('a=b', $request->getQuery()); - if ($body) { - $this->assertEquals($body, $request->getBody()); - } - } - - public function testClientMergesDefaultOptionsWithRequestOptions() - { - $f = $this->getMockBuilder('GuzzleHttp\Message\MessageFactoryInterface') - ->setMethods(array('createRequest')) - ->getMockForAbstractClass(); - - $o = null; - // Intercept the creation - $f->expects($this->once()) - ->method('createRequest') - ->will($this->returnCallback( - function ($method, $url, array $options = []) use (&$o) { - $o = $options; - return (new MessageFactory())->createRequest($method, $url, $options); - } - )); - - $client = new Client([ - 'message_factory' => $f, - 'defaults' => [ - 'headers' => ['Foo' => 'Bar'], - 'query' => ['baz' => 'bam'], - 'exceptions' => false - ] - ]); - - $request = $client->createRequest('GET', 'http://foo.com?a=b', [ - 'headers' => ['Hi' => 'there', '1' => 'one'], - 'allow_redirects' => false, - 'query' => ['t' => 1] - ]); - - $this->assertFalse($o['allow_redirects']); - $this->assertFalse($o['exceptions']); - $this->assertEquals('Bar', $request->getHeader('Foo')); - $this->assertEquals('there', $request->getHeader('Hi')); - $this->assertEquals('one', $request->getHeader('1')); - $this->assertEquals('a=b&baz=bam&t=1', $request->getQuery()); - } - - public function testClientMergesDefaultHeadersCaseInsensitively() - { - $client = new Client(['defaults' => ['headers' => ['Foo' => 'Bar']]]); - $request = $client->createRequest('GET', 'http://foo.com?a=b', [ - 'headers' => ['foo' => 'custom', 'user-agent' => 'test'] - ]); - $this->assertEquals('test', $request->getHeader('User-Agent')); - $this->assertEquals('custom', $request->getHeader('Foo')); - } - - public function testCanOverrideDefaultOptionWithNull() - { - $client = new Client(['defaults' => ['proxy' => 'invalid!']]); - $request = $client->createRequest('GET', 'http://foo.com?a=b', [ - 'proxy' => null - ]); - $this->assertFalse($request->getConfig()->hasKey('proxy')); - } - - public function testDoesNotOverwriteExistingUA() - { - $client = new Client(['defaults' => [ - 'headers' => ['User-Agent' => 'test'] - ]]); - $this->assertEquals( - ['User-Agent' => 'test'], - $client->getDefaultOption('headers') - ); - } - - public function testUsesBaseUrlWhenNoUrlIsSet() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/baz?bam=bar', - $client->createRequest('GET')->getUrl() - ); - } - - public function testUsesBaseUrlCombinedWithProvidedUrl() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/bar/bam', - $client->createRequest('GET', 'bar/bam')->getUrl() - ); - } - - public function testFalsyPathsAreCombinedWithBaseUrl() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/0', - $client->createRequest('GET', '0')->getUrl() - ); - } - - public function testUsesBaseUrlCombinedWithProvidedUrlViaUriTemplate() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/bar/123', - $client->createRequest('GET', ['bar/{bam}', ['bam' => '123']])->getUrl() - ); - } - - public function testSettingAbsoluteUrlOverridesBaseUrl() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://www.foo.com/foo', - $client->createRequest('GET', '/foo')->getUrl() - ); - } - - public function testSettingAbsoluteUriTemplateOverridesBaseUrl() - { - $client = new Client(['base_url' => 'http://www.foo.com/baz?bam=bar']); - $this->assertEquals( - 'http://goo.com/1', - $client->createRequest( - 'GET', - ['http://goo.com/{bar}', ['bar' => '1']] - )->getUrl() - ); - } - - public function testCanSetRelativeUrlStartingWithHttp() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $this->assertEquals( - 'http://www.foo.com/httpfoo', - $client->createRequest('GET', 'httpfoo')->getUrl() - ); - } - - /** - * Test that base URLs ending with a slash are resolved as per RFC3986. - * - * @link http://tools.ietf.org/html/rfc3986#section-5.2.3 - */ - public function testMultipleSubdirectoryWithSlash() - { - $client = new Client(['base_url' => 'http://www.foo.com/bar/bam/']); - $this->assertEquals( - 'http://www.foo.com/bar/bam/httpfoo', - $client->createRequest('GET', 'httpfoo')->getUrl() - ); - } - - /** - * Test that base URLs ending without a slash are resolved as per RFC3986. - * - * @link http://tools.ietf.org/html/rfc3986#section-5.2.3 - */ - public function testMultipleSubdirectoryNoSlash() - { - $client = new Client(['base_url' => 'http://www.foo.com/bar/bam']); - $this->assertEquals( - 'http://www.foo.com/bar/httpfoo', - $client->createRequest('GET', 'httpfoo')->getUrl() - ); - } - - public function testClientSendsRequests() - { - $mock = new MockHandler(['status' => 200, 'headers' => []]); - $client = new Client(['handler' => $mock]); - $response = $client->get('http://test.com'); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('http://test.com', $response->getEffectiveUrl()); - } - - public function testSendingRequestCanBeIntercepted() - { - $response = new Response(200); - $client = new Client(['handler' => $this->ma]); - $client->getEmitter()->on( - 'before', - function (BeforeEvent $e) use ($response) { - $e->intercept($response); - } - ); - $this->assertSame($response, $client->get('http://test.com')); - $this->assertEquals('http://test.com', $response->getEffectiveUrl()); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage Argument 1 passed to GuzzleHttp\Message\FutureResponse::proxy() must implement interface GuzzleHttp\Ring\Future\FutureInterface - */ - public function testEnsuresResponseIsPresentAfterSending() - { - $handler = function () {}; - $client = new Client(['handler' => $handler]); - $client->get('http://httpbin.org'); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage Waiting did not resolve future - */ - public function testEnsuresResponseIsPresentAfterDereferencing() - { - $deferred = new Deferred(); - $handler = new MockHandler(function () use ($deferred) { - return new FutureArray( - $deferred->promise(), - function () {} - ); - }); - $client = new Client(['handler' => $handler]); - $response = $client->get('http://httpbin.org'); - $response->wait(); - } - - public function testClientHandlesErrorsDuringBeforeSend() - { - $client = new Client(); - $client->getEmitter()->on('before', function ($e) { - throw new \Exception('foo'); - }); - $client->getEmitter()->on('error', function (ErrorEvent $e) { - $e->intercept(new Response(200)); - }); - $this->assertEquals( - 200, - $client->get('http://test.com')->getStatusCode() - ); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage foo - */ - public function testClientHandlesErrorsDuringBeforeSendAndThrowsIfUnhandled() - { - $client = new Client(); - $client->getEmitter()->on('before', function (BeforeEvent $e) { - throw new RequestException('foo', $e->getRequest()); - }); - $client->get('http://httpbin.org'); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage foo - */ - public function testClientWrapsExceptions() - { - $client = new Client(); - $client->getEmitter()->on('before', function (BeforeEvent $e) { - throw new \Exception('foo'); - }); - $client->get('http://httpbin.org'); - } - - public function testCanInjectResponseForFutureError() - { - $calledFuture = false; - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () use ($deferred, &$calledFuture) { - $calledFuture = true; - $deferred->resolve(['error' => new \Exception('Noo!')]); - } - ); - $mock = new MockHandler($future); - $client = new Client(['handler' => $mock]); - $called = 0; - $response = $client->get('http://localhost:123/foo', [ - 'future' => true, - 'events' => [ - 'error' => function (ErrorEvent $e) use (&$called) { - $called++; - $e->intercept(new Response(200)); - } - ] - ]); - $this->assertEquals(0, $called); - $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $response); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertTrue($calledFuture); - $this->assertEquals(1, $called); - } - - public function testCanReturnFutureResults() - { - $called = false; - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () use ($deferred, &$called) { - $called = true; - $deferred->resolve(['status' => 201, 'headers' => []]); - } - ); - $mock = new MockHandler($future); - $client = new Client(['handler' => $mock]); - $response = $client->get('http://localhost:123/foo', ['future' => true]); - $this->assertFalse($called); - $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $response); - $this->assertEquals(201, $response->getStatusCode()); - $this->assertTrue($called); - } - - public function testThrowsExceptionsWhenDereferenced() - { - $calledFuture = false; - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function () use ($deferred, &$calledFuture) { - $calledFuture = true; - $deferred->resolve(['error' => new \Exception('Noop!')]); - } - ); - $client = new Client(['handler' => new MockHandler($future)]); - try { - $res = $client->get('http://localhost:123/foo', ['future' => true]); - $res->wait(); - $this->fail('Did not throw'); - } catch (RequestException $e) { - $this->assertEquals(1, $calledFuture); - } - } - - /** - * @expectedExceptionMessage Noo! - * @expectedException \GuzzleHttp\Exception\RequestException - */ - public function testThrowsExceptionsSynchronously() - { - $client = new Client([ - 'handler' => new MockHandler(['error' => new \Exception('Noo!')]) - ]); - $client->get('http://localhost:123/foo'); - } - - public function testCanSetDefaultValues() - { - $client = new Client(['foo' => 'bar']); - $client->setDefaultOption('headers/foo', 'bar'); - $this->assertNull($client->getDefaultOption('foo')); - $this->assertEquals('bar', $client->getDefaultOption('headers/foo')); - } - - public function testSendsAllInParallel() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([ - new Response(200), - new Response(201), - new Response(202), - ])); - $history = new History(); - $client->getEmitter()->attach($history); - - $requests = [ - $client->createRequest('GET', 'http://test.com'), - $client->createRequest('POST', 'http://test.com'), - $client->createRequest('PUT', 'http://test.com') - ]; - - $client->sendAll($requests); - $requests = array_map(function($r) { - return $r->getMethod(); - }, $history->getRequests()); - $this->assertContains('GET', $requests); - $this->assertContains('POST', $requests); - $this->assertContains('PUT', $requests); - } - - public function testCanDisableAuthPerRequest() - { - $client = new Client(['defaults' => ['auth' => 'foo']]); - $request = $client->createRequest('GET', 'http://test.com'); - $this->assertEquals('foo', $request->getConfig()['auth']); - $request = $client->createRequest('GET', 'http://test.com', ['auth' => null]); - $this->assertFalse($request->getConfig()->hasKey('auth')); - } - - public function testUsesProxyEnvironmentVariables() - { - $http = getenv('HTTP_PROXY'); - $https = getenv('HTTPS_PROXY'); - - $client = new Client(); - $this->assertNull($client->getDefaultOption('proxy')); - - putenv('HTTP_PROXY=127.0.0.1'); - $client = new Client(); - $this->assertEquals( - ['http' => '127.0.0.1'], - $client->getDefaultOption('proxy') - ); - - putenv('HTTPS_PROXY=127.0.0.2'); - $client = new Client(); - $this->assertEquals( - ['http' => '127.0.0.1', 'https' => '127.0.0.2'], - $client->getDefaultOption('proxy') - ); - - putenv("HTTP_PROXY=$http"); - putenv("HTTPS_PROXY=$https"); - } - - public function testReturnsFutureForErrorWhenRequested() - { - $client = new Client(['handler' => new MockHandler(['status' => 404])]); - $request = $client->createRequest('GET', 'http://localhost:123/foo', [ - 'future' => true - ]); - $res = $client->send($request); - $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $res); - try { - $res->wait(); - $this->fail('did not throw'); - } catch (RequestException $e) { - $this->assertContains('404', $e->getMessage()); - } - } - - public function testReturnsFutureForResponseWhenRequested() - { - $client = new Client(['handler' => new MockHandler(['status' => 200])]); - $request = $client->createRequest('GET', 'http://localhost:123/foo', [ - 'future' => true - ]); - $res = $client->send($request); - $this->assertInstanceOf('GuzzleHttp\Message\FutureResponse', $res); - $this->assertEquals(200, $res->getStatusCode()); - } - - public function testCanUseUrlWithCustomQuery() - { - $client = new Client(); - $url = Url::fromString('http://foo.com/bar'); - $query = new Query(['baz' => '123%20']); - $query->setEncodingType(false); - $url->setQuery($query); - $r = $client->createRequest('GET', $url); - $this->assertEquals('http://foo.com/bar?baz=123%20', $r->getUrl()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/CollectionTest.php b/vendor/guzzlehttp/guzzle/tests/CollectionTest.php deleted file mode 100644 index 8c532aaf..00000000 --- a/vendor/guzzlehttp/guzzle/tests/CollectionTest.php +++ /dev/null @@ -1,416 +0,0 @@ -coll = new Collection(); - } - - public function testConstructorCanBeCalledWithNoParams() - { - $this->coll = new Collection(); - $p = $this->coll->toArray(); - $this->assertEmpty($p, '-> Collection must be empty when no data is passed'); - } - - public function testConstructorCanBeCalledWithParams() - { - $testData = array( - 'test' => 'value', - 'test_2' => 'value2' - ); - $this->coll = new Collection($testData); - $this->assertEquals($this->coll->toArray(), $testData); - $this->assertEquals($this->coll->toArray(), $this->coll->toArray()); - } - - public function testImplementsIteratorAggregate() - { - $this->coll->set('key', 'value'); - $this->assertInstanceOf('ArrayIterator', $this->coll->getIterator()); - $this->assertEquals(1, count($this->coll)); - $total = 0; - foreach ($this->coll as $key => $value) { - $this->assertEquals('key', $key); - $this->assertEquals('value', $value); - $total++; - } - $this->assertEquals(1, $total); - } - - public function testCanAddValuesToExistingKeysByUsingArray() - { - $this->coll->add('test', 'value1'); - $this->assertEquals($this->coll->toArray(), array('test' => 'value1')); - $this->coll->add('test', 'value2'); - $this->assertEquals($this->coll->toArray(), array('test' => array('value1', 'value2'))); - $this->coll->add('test', 'value3'); - $this->assertEquals($this->coll->toArray(), array('test' => array('value1', 'value2', 'value3'))); - } - - public function testHandlesMergingInDisparateDataSources() - { - $params = array( - 'test' => 'value1', - 'test2' => 'value2', - 'test3' => array('value3', 'value4') - ); - $this->coll->merge($params); - $this->assertEquals($this->coll->toArray(), $params); - $this->coll->merge(new Collection(['test4' => 'hi'])); - $this->assertEquals( - $this->coll->toArray(), - $params + ['test4' => 'hi'] - ); - } - - public function testCanClearAllDataOrSpecificKeys() - { - $this->coll->merge(array( - 'test' => 'value1', - 'test2' => 'value2' - )); - - // Clear a specific parameter by name - $this->coll->remove('test'); - - $this->assertEquals($this->coll->toArray(), array( - 'test2' => 'value2' - )); - - // Clear all parameters - $this->coll->clear(); - - $this->assertEquals($this->coll->toArray(), array()); - } - - public function testProvidesKeys() - { - $this->assertEquals(array(), $this->coll->getKeys()); - $this->coll->merge(array( - 'test1' => 'value1', - 'test2' => 'value2' - )); - $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys()); - // Returns the cached array previously returned - $this->assertEquals(array('test1', 'test2'), $this->coll->getKeys()); - $this->coll->remove('test1'); - $this->assertEquals(array('test2'), $this->coll->getKeys()); - $this->coll->add('test3', 'value3'); - $this->assertEquals(array('test2', 'test3'), $this->coll->getKeys()); - } - - public function testChecksIfHasKey() - { - $this->assertFalse($this->coll->hasKey('test')); - $this->coll->add('test', 'value'); - $this->assertEquals(true, $this->coll->hasKey('test')); - $this->coll->add('test2', 'value2'); - $this->assertEquals(true, $this->coll->hasKey('test')); - $this->assertEquals(true, $this->coll->hasKey('test2')); - $this->assertFalse($this->coll->hasKey('testing')); - $this->assertEquals(false, $this->coll->hasKey('AB-C', 'junk')); - } - - public function testChecksIfHasValue() - { - $this->assertFalse($this->coll->hasValue('value')); - $this->coll->add('test', 'value'); - $this->assertEquals('test', $this->coll->hasValue('value')); - $this->coll->add('test2', 'value2'); - $this->assertEquals('test', $this->coll->hasValue('value')); - $this->assertEquals('test2', $this->coll->hasValue('value2')); - $this->assertFalse($this->coll->hasValue('val')); - } - - public function testImplementsCount() - { - $data = new Collection(); - $this->assertEquals(0, $data->count()); - $data->add('key', 'value'); - $this->assertEquals(1, count($data)); - $data->add('key', 'value2'); - $this->assertEquals(1, count($data)); - $data->add('key_2', 'value3'); - $this->assertEquals(2, count($data)); - } - - public function testAddParamsByMerging() - { - $params = array( - 'test' => 'value1', - 'test2' => 'value2', - 'test3' => array('value3', 'value4') - ); - - // Add some parameters - $this->coll->merge($params); - - // Add more parameters by merging them in - $this->coll->merge(array( - 'test' => 'another', - 'different_key' => 'new value' - )); - - $this->assertEquals(array( - 'test' => array('value1', 'another'), - 'test2' => 'value2', - 'test3' => array('value3', 'value4'), - 'different_key' => 'new value' - ), $this->coll->toArray()); - } - - public function testAllowsFunctionalFilter() - { - $this->coll->merge(array( - 'fruit' => 'apple', - 'number' => 'ten', - 'prepositions' => array('about', 'above', 'across', 'after'), - 'same_number' => 'ten' - )); - - $filtered = $this->coll->filter(function ($key, $value) { - return $value == 'ten'; - }); - - $this->assertNotSame($filtered, $this->coll); - - $this->assertEquals(array( - 'number' => 'ten', - 'same_number' => 'ten' - ), $filtered->toArray()); - } - - public function testAllowsFunctionalMapping() - { - $this->coll->merge(array( - 'number_1' => 1, - 'number_2' => 2, - 'number_3' => 3 - )); - - $mapped = $this->coll->map(function ($key, $value) { - return $value * $value; - }); - - $this->assertNotSame($mapped, $this->coll); - - $this->assertEquals(array( - 'number_1' => 1, - 'number_2' => 4, - 'number_3' => 9 - ), $mapped->toArray()); - } - - public function testImplementsArrayAccess() - { - $this->coll->merge(array( - 'k1' => 'v1', - 'k2' => 'v2' - )); - - $this->assertTrue($this->coll->offsetExists('k1')); - $this->assertFalse($this->coll->offsetExists('Krull')); - - $this->coll->offsetSet('k3', 'v3'); - $this->assertEquals('v3', $this->coll->offsetGet('k3')); - $this->assertEquals('v3', $this->coll->get('k3')); - - $this->coll->offsetUnset('k1'); - $this->assertFalse($this->coll->offsetExists('k1')); - } - - public function testCanReplaceAllData() - { - $this->coll->replace(array('a' => '123')); - $this->assertEquals(array('a' => '123'), $this->coll->toArray()); - } - - public function testPreparesFromConfig() - { - $c = Collection::fromConfig(array( - 'a' => '123', - 'base_url' => 'http://www.test.com/' - ), array( - 'a' => 'xyz', - 'b' => 'lol' - ), array('a')); - - $this->assertInstanceOf('GuzzleHttp\Collection', $c); - $this->assertEquals(array( - 'a' => '123', - 'b' => 'lol', - 'base_url' => 'http://www.test.com/' - ), $c->toArray()); - - try { - Collection::fromConfig(array(), array(), array('a')); - $this->fail('Exception not throw when missing config'); - } catch (\InvalidArgumentException $e) { - } - } - - function falseyDataProvider() - { - return array( - array(false, false), - array(null, null), - array('', ''), - array(array(), array()), - array(0, 0), - ); - } - - /** - * @dataProvider falseyDataProvider - */ - public function testReturnsCorrectData($a, $b) - { - $c = new Collection(array('value' => $a)); - $this->assertSame($b, $c->get('value')); - } - - public function testRetrievesNestedKeysUsingPath() - { - $data = array( - 'foo' => 'bar', - 'baz' => array( - 'mesa' => array( - 'jar' => 'jar' - ) - ) - ); - $collection = new Collection($data); - $this->assertEquals('bar', $collection->getPath('foo')); - $this->assertEquals('jar', $collection->getPath('baz/mesa/jar')); - $this->assertNull($collection->getPath('wewewf')); - $this->assertNull($collection->getPath('baz/mesa/jar/jar')); - } - - public function testFalseyKeysStillDescend() - { - $collection = new Collection(array( - '0' => array( - 'a' => 'jar' - ), - 1 => 'other' - )); - $this->assertEquals('jar', $collection->getPath('0/a')); - $this->assertEquals('other', $collection->getPath('1')); - } - - public function getPathProvider() - { - $data = array( - 'foo' => 'bar', - 'baz' => array( - 'mesa' => array( - 'jar' => 'jar', - 'array' => array('a', 'b', 'c') - ), - 'bar' => array( - 'baz' => 'bam', - 'array' => array('d', 'e', 'f') - ) - ), - 'bam' => array( - array('foo' => 1), - array('foo' => 2), - array('array' => array('h', 'i')) - ) - ); - $c = new Collection($data); - - return array( - // Simple path selectors - array($c, 'foo', 'bar'), - array($c, 'baz', $data['baz']), - array($c, 'bam', $data['bam']), - array($c, 'baz/mesa', $data['baz']['mesa']), - array($c, 'baz/mesa/jar', 'jar'), - // Does not barf on missing keys - array($c, 'fefwfw', null), - array($c, 'baz/mesa/array', $data['baz']['mesa']['array']) - ); - } - - /** - * @dataProvider getPathProvider - */ - public function testGetPath(Collection $c, $path, $expected, $separator = '/') - { - $this->assertEquals($expected, $c->getPath($path, $separator)); - } - - public function testOverridesSettings() - { - $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3)); - $c->overwriteWith(array('foo' => 10, 'bar' => 300)); - $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray()); - } - - public function testOverwriteWithCollection() - { - $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3)); - $b = new Collection(array('foo' => 10, 'bar' => 300)); - $c->overwriteWith($b); - $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray()); - } - - public function testOverwriteWithTraversable() - { - $c = new Collection(array('foo' => 1, 'baz' => 2, 'bar' => 3)); - $b = new Collection(array('foo' => 10, 'bar' => 300)); - $c->overwriteWith($b->getIterator()); - $this->assertEquals(array('foo' => 10, 'baz' => 2, 'bar' => 300), $c->toArray()); - } - - public function testCanSetNestedPathValueThatDoesNotExist() - { - $c = new Collection(array()); - $c->setPath('foo/bar/baz/123', 'hi'); - $this->assertEquals('hi', $c['foo']['bar']['baz']['123']); - } - - public function testCanSetNestedPathValueThatExists() - { - $c = new Collection(array('foo' => array('bar' => 'test'))); - $c->setPath('foo/bar', 'hi'); - $this->assertEquals('hi', $c['foo']['bar']); - } - - /** - * @expectedException \RuntimeException - */ - public function testVerifiesNestedPathIsValidAtExactLevel() - { - $c = new Collection(array('foo' => 'bar')); - $c->setPath('foo/bar', 'hi'); - $this->assertEquals('hi', $c['foo']['bar']); - } - - /** - * @expectedException \RuntimeException - */ - public function testVerifiesThatNestedPathIsValidAtAnyLevel() - { - $c = new Collection(array('foo' => 'bar')); - $c->setPath('foo/bar/baz', 'test'); - } - - public function testCanAppendToNestedPathValues() - { - $c = new Collection(); - $c->setPath('foo/bar/[]', 'a'); - $c->setPath('foo/bar/[]', 'b'); - $this->assertEquals(['a', 'b'], $c['foo']['bar']); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php b/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php deleted file mode 100644 index 1360419d..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Cookie/CookieJarTest.php +++ /dev/null @@ -1,339 +0,0 @@ -jar = new CookieJar(); - } - - protected function getTestCookies() - { - return [ - new SetCookie(['Name' => 'foo', 'Value' => 'bar', 'Domain' => 'foo.com', 'Path' => '/', 'Discard' => true]), - new SetCookie(['Name' => 'test', 'Value' => '123', 'Domain' => 'baz.com', 'Path' => '/foo', 'Expires' => 2]), - new SetCookie(['Name' => 'you', 'Value' => '123', 'Domain' => 'bar.com', 'Path' => '/boo', 'Expires' => time() + 1000]) - ]; - } - - public function testQuotesBadCookieValues() - { - $this->assertEquals('foo', CookieJar::getCookieValue('foo')); - $this->assertEquals('"foo,bar"', CookieJar::getCookieValue('foo,bar')); - } - - public function testCreatesFromArray() - { - $jar = CookieJar::fromArray([ - 'foo' => 'bar', - 'baz' => 'bam' - ], 'example.com'); - $this->assertCount(2, $jar); - } - - /** - * Provides test data for cookie cookieJar retrieval - */ - public function getCookiesDataProvider() - { - return [ - [['foo', 'baz', 'test', 'muppet', 'googoo'], '', '', '', false], - [['foo', 'baz', 'muppet', 'googoo'], '', '', '', true], - [['googoo'], 'www.example.com', '', '', false], - [['muppet', 'googoo'], 'test.y.example.com', '', '', false], - [['foo', 'baz'], 'example.com', '', '', false], - [['muppet'], 'x.y.example.com', '/acme/', '', false], - [['muppet'], 'x.y.example.com', '/acme/test/', '', false], - [['googoo'], 'x.y.example.com', '/test/acme/test/', '', false], - [['foo', 'baz'], 'example.com', '', '', false], - [['baz'], 'example.com', '', 'baz', false], - ]; - } - - public function testStoresAndRetrievesCookies() - { - $cookies = $this->getTestCookies(); - foreach ($cookies as $cookie) { - $this->assertTrue($this->jar->setCookie($cookie)); - } - - $this->assertEquals(3, count($this->jar)); - $this->assertEquals(3, count($this->jar->getIterator())); - $this->assertEquals($cookies, $this->jar->getIterator()->getArrayCopy()); - } - - public function testRemovesTemporaryCookies() - { - $cookies = $this->getTestCookies(); - foreach ($this->getTestCookies() as $cookie) { - $this->jar->setCookie($cookie); - } - $this->jar->clearSessionCookies(); - $this->assertEquals( - [$cookies[1], $cookies[2]], - $this->jar->getIterator()->getArrayCopy() - ); - } - - public function testRemovesSelectively() - { - foreach ($this->getTestCookies() as $cookie) { - $this->jar->setCookie($cookie); - } - - // Remove foo.com cookies - $this->jar->clear('foo.com'); - $this->assertEquals(2, count($this->jar)); - // Try again, removing no further cookies - $this->jar->clear('foo.com'); - $this->assertEquals(2, count($this->jar)); - - // Remove bar.com cookies with path of /boo - $this->jar->clear('bar.com', '/boo'); - $this->assertEquals(1, count($this->jar)); - - // Remove cookie by name - $this->jar->clear(null, null, 'test'); - $this->assertEquals(0, count($this->jar)); - } - - public function testDoesNotAddIncompleteCookies() - { - $this->assertEquals(false, $this->jar->setCookie(new SetCookie())); - $this->assertFalse($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo' - )))); - $this->assertFalse($this->jar->setCookie(new SetCookie(array( - 'Name' => false - )))); - $this->assertFalse($this->jar->setCookie(new SetCookie(array( - 'Name' => true - )))); - $this->assertFalse($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo', - 'Domain' => 'foo.com' - )))); - } - - public function testDoesAddValidCookies() - { - $this->assertTrue($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => 0 - )))); - $this->assertTrue($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => 0.0 - )))); - $this->assertTrue($this->jar->setCookie(new SetCookie(array( - 'Name' => 'foo', - 'Domain' => 'foo.com', - 'Value' => '0' - )))); - } - - public function testOverwritesCookiesThatAreOlderOrDiscardable() - { - $t = time() + 1000; - $data = array( - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => '.example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true, - 'Discard' => true, - 'Expires' => $t - ); - - // Make sure that the discard cookie is overridden with the non-discard - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - - $data['Discard'] = false; - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - - $c = $this->jar->getIterator()->getArrayCopy(); - $this->assertEquals(false, $c[0]->getDiscard()); - - // Make sure it doesn't duplicate the cookie - $this->jar->setCookie(new SetCookie($data)); - $this->assertEquals(1, count($this->jar)); - - // Make sure the more future-ful expiration date supersede the other - $data['Expires'] = time() + 2000; - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - $c = $this->jar->getIterator()->getArrayCopy(); - $this->assertNotEquals($t, $c[0]->getExpires()); - } - - public function testOverwritesCookiesThatHaveChanged() - { - $t = time() + 1000; - $data = array( - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => '.example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true, - 'Discard' => true, - 'Expires' => $t - ); - - // Make sure that the discard cookie is overridden with the non-discard - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - - $data['Value'] = 'boo'; - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - - // Changing the value plus a parameter also must overwrite the existing one - $data['Value'] = 'zoo'; - $data['Secure'] = false; - $this->assertTrue($this->jar->setCookie(new SetCookie($data))); - $this->assertEquals(1, count($this->jar)); - - $c = $this->jar->getIterator()->getArrayCopy(); - $this->assertEquals('zoo', $c[0]->getValue()); - } - - public function testAddsCookiesFromResponseWithRequest() - { - $response = new Response(200, array( - 'Set-Cookie' => "fpc=d=.Hm.yh4.1XmJWjJfs4orLQzKzPImxklQoxXSHOZATHUSEFciRueW_7704iYUtsXNEXq0M92Px2glMdWypmJ7HIQl6XIUvrZimWjQ3vIdeuRbI.FNQMAfcxu_XN1zSx7l.AcPdKL6guHc2V7hIQFhnjRW0rxm2oHY1P4bGQxFNz7f.tHm12ZD3DbdMDiDy7TBXsuP4DM-&v=2; expires=Fri, 02-Mar-2019 02:17:40 GMT;" - )); - $request = new Request('GET', 'http://www.example.com'); - $this->jar->extractCookies($request, $response); - $this->assertEquals(1, count($this->jar)); - } - - public function getMatchingCookiesDataProvider() - { - return array( - array('https://example.com', 'foo=bar; baz=foobar'), - array('http://example.com', ''), - array('https://example.com:8912', 'foo=bar; baz=foobar'), - array('https://foo.example.com', 'foo=bar; baz=foobar'), - array('http://foo.example.com/test/acme/', 'googoo=gaga') - ); - } - - /** - * @dataProvider getMatchingCookiesDataProvider - */ - public function testReturnsCookiesMatchingRequests($url, $cookies) - { - $bag = [ - new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true - ]), - new SetCookie([ - 'Name' => 'baz', - 'Value' => 'foobar', - 'Domain' => 'example.com', - 'Path' => '/', - 'Max-Age' => '86400', - 'Secure' => true - ]), - new SetCookie([ - 'Name' => 'test', - 'Value' => '123', - 'Domain' => 'www.foobar.com', - 'Path' => '/path/', - 'Discard' => true - ]), - new SetCookie([ - 'Name' => 'muppet', - 'Value' => 'cookie_monster', - 'Domain' => '.y.example.com', - 'Path' => '/acme/', - 'Expires' => time() + 86400 - ]), - new SetCookie([ - 'Name' => 'googoo', - 'Value' => 'gaga', - 'Domain' => '.example.com', - 'Path' => '/test/acme/', - 'Max-Age' => 1500 - ]) - ]; - - foreach ($bag as $cookie) { - $this->jar->setCookie($cookie); - } - - $request = new Request('GET', $url); - $this->jar->addCookieHeader($request); - $this->assertEquals($cookies, $request->getHeader('Cookie')); - } - - /** - * @expectedException \RuntimeException - * @expectedExceptionMessage Invalid cookie: Cookie name must not cannot invalid characters: - */ - public function testThrowsExceptionWithStrictMode() - { - $a = new CookieJar(true); - $a->setCookie(new SetCookie(['Name' => "abc\n", 'Value' => 'foo', 'Domain' => 'bar'])); - } - - public function testDeletesCookiesByName() - { - $cookies = $this->getTestCookies(); - $cookies[] = new SetCookie([ - 'Name' => 'other', - 'Value' => '123', - 'Domain' => 'bar.com', - 'Path' => '/boo', - 'Expires' => time() + 1000 - ]); - $jar = new CookieJar(); - foreach ($cookies as $cookie) { - $jar->setCookie($cookie); - } - $this->assertCount(4, $jar); - $jar->clear('bar.com', '/boo', 'other'); - $this->assertCount(3, $jar); - $names = array_map(function (SetCookie $c) { - return $c->getName(); - }, $jar->getIterator()->getArrayCopy()); - $this->assertEquals(['foo', 'test', 'you'], $names); - } - - public function testCanConvertToAndLoadFromArray() - { - $jar = new CookieJar(true); - foreach ($this->getTestCookies() as $cookie) { - $jar->setCookie($cookie); - } - $this->assertCount(3, $jar); - $arr = $jar->toArray(); - $this->assertCount(3, $arr); - $newCookieJar = new CookieJar(false, $arr); - $this->assertCount(3, $newCookieJar); - $this->assertSame($jar->toArray(), $newCookieJar->toArray()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php b/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php deleted file mode 100644 index 1d113371..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Cookie/FileCookieJarTest.php +++ /dev/null @@ -1,71 +0,0 @@ -file = tempnam('/tmp', 'file-cookies'); - } - - /** - * @expectedException \RuntimeException - */ - public function testValidatesCookieFile() - { - file_put_contents($this->file, 'true'); - new FileCookieJar($this->file); - } - - public function testLoadsFromFileFile() - { - $jar = new FileCookieJar($this->file); - $this->assertEquals([], $jar->getIterator()->getArrayCopy()); - unlink($this->file); - } - - public function testPersistsToFileFile() - { - $jar = new FileCookieJar($this->file); - $jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'baz', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'boo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - ])); - - $this->assertEquals(3, count($jar)); - unset($jar); - - // Make sure it wrote to the file - $contents = file_get_contents($this->file); - $this->assertNotEmpty($contents); - - // Load the cookieJar from the file - $jar = new FileCookieJar($this->file); - - // Weeds out temporary and session cookies - $this->assertEquals(2, count($jar)); - unset($jar); - unlink($this->file); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php b/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php deleted file mode 100644 index ccc6d4ee..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Cookie/SessionCookieJarTest.php +++ /dev/null @@ -1,76 +0,0 @@ -sessionVar = 'sessionKey'; - - if (!isset($_SESSION)) { - $_SESSION = array(); - } - } - - /** - * @expectedException \RuntimeException - */ - public function testValidatesCookieSession() - { - $_SESSION[$this->sessionVar] = 'true'; - new SessionCookieJar($this->sessionVar); - } - - public function testLoadsFromSession() - { - $jar = new SessionCookieJar($this->sessionVar); - $this->assertEquals([], $jar->getIterator()->getArrayCopy()); - unset($_SESSION[$this->sessionVar]); - } - - public function testPersistsToSession() - { - $jar = new SessionCookieJar($this->sessionVar); - $jar->setCookie(new SetCookie([ - 'Name' => 'foo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'baz', - 'Value' => 'bar', - 'Domain' => 'foo.com', - 'Expires' => time() + 1000 - ])); - $jar->setCookie(new SetCookie([ - 'Name' => 'boo', - 'Value' => 'bar', - 'Domain' => 'foo.com', - ])); - - $this->assertEquals(3, count($jar)); - unset($jar); - - // Make sure it wrote to the sessionVar in $_SESSION - $contents = $_SESSION[$this->sessionVar]; - $this->assertNotEmpty($contents); - - // Load the cookieJar from the file - $jar = new SessionCookieJar($this->sessionVar); - - // Weeds out temporary and session cookies - $this->assertEquals(2, count($jar)); - unset($jar); - unset($_SESSION[$this->sessionVar]); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php b/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php deleted file mode 100644 index 3ddd0820..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Cookie/SetCookieTest.php +++ /dev/null @@ -1,364 +0,0 @@ -assertEquals('/', $cookie->getPath()); - } - - public function testConvertsDateTimeMaxAgeToUnixTimestamp() - { - $cookie = new SetCookie(['Expires' => 'November 20, 1984']); - $this->assertInternalType('integer', $cookie->getExpires()); - } - - public function testAddsExpiresBasedOnMaxAge() - { - $t = time(); - $cookie = new SetCookie(['Max-Age' => 100]); - $this->assertEquals($t + 100, $cookie->getExpires()); - } - - public function testHoldsValues() - { - $t = time(); - $data = array( - 'Name' => 'foo', - 'Value' => 'baz', - 'Path' => '/bar', - 'Domain' => 'baz.com', - 'Expires' => $t, - 'Max-Age' => 100, - 'Secure' => true, - 'Discard' => true, - 'HttpOnly' => true, - 'foo' => 'baz', - 'bar' => 'bam' - ); - - $cookie = new SetCookie($data); - $this->assertEquals($data, $cookie->toArray()); - - $this->assertEquals('foo', $cookie->getName()); - $this->assertEquals('baz', $cookie->getValue()); - $this->assertEquals('baz.com', $cookie->getDomain()); - $this->assertEquals('/bar', $cookie->getPath()); - $this->assertEquals($t, $cookie->getExpires()); - $this->assertEquals(100, $cookie->getMaxAge()); - $this->assertTrue($cookie->getSecure()); - $this->assertTrue($cookie->getDiscard()); - $this->assertTrue($cookie->getHttpOnly()); - $this->assertEquals('baz', $cookie->toArray()['foo']); - $this->assertEquals('bam', $cookie->toArray()['bar']); - - $cookie->setName('a'); - $cookie->setValue('b'); - $cookie->setPath('c'); - $cookie->setDomain('bar.com'); - $cookie->setExpires(10); - $cookie->setMaxAge(200); - $cookie->setSecure(false); - $cookie->setHttpOnly(false); - $cookie->setDiscard(false); - - $this->assertEquals('a', $cookie->getName()); - $this->assertEquals('b', $cookie->getValue()); - $this->assertEquals('c', $cookie->getPath()); - $this->assertEquals('bar.com', $cookie->getDomain()); - $this->assertEquals(10, $cookie->getExpires()); - $this->assertEquals(200, $cookie->getMaxAge()); - $this->assertFalse($cookie->getSecure()); - $this->assertFalse($cookie->getDiscard()); - $this->assertFalse($cookie->getHttpOnly()); - } - - public function testDeterminesIfExpired() - { - $c = new SetCookie(); - $c->setExpires(10); - $this->assertTrue($c->isExpired()); - $c->setExpires(time() + 10000); - $this->assertFalse($c->isExpired()); - } - - public function testMatchesDomain() - { - $cookie = new SetCookie(); - $this->assertTrue($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('baz.com'); - $this->assertTrue($cookie->matchesDomain('baz.com')); - $this->assertFalse($cookie->matchesDomain('bar.com')); - - $cookie->setDomain('.baz.com'); - $this->assertTrue($cookie->matchesDomain('.baz.com')); - $this->assertTrue($cookie->matchesDomain('foo.baz.com')); - $this->assertFalse($cookie->matchesDomain('baz.bar.com')); - $this->assertTrue($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('.127.0.0.1'); - $this->assertTrue($cookie->matchesDomain('127.0.0.1')); - - $cookie->setDomain('127.0.0.1'); - $this->assertTrue($cookie->matchesDomain('127.0.0.1')); - - $cookie->setDomain('.com.'); - $this->assertFalse($cookie->matchesDomain('baz.com')); - - $cookie->setDomain('.local'); - $this->assertTrue($cookie->matchesDomain('example.local')); - } - - public function testMatchesPath() - { - $cookie = new SetCookie(); - $this->assertTrue($cookie->matchesPath('/foo')); - - $cookie->setPath('/foo'); - $this->assertTrue($cookie->matchesPath('/foo')); - $this->assertTrue($cookie->matchesPath('/foo/bar')); - $this->assertFalse($cookie->matchesPath('/bar')); - } - - public function cookieValidateProvider() - { - return array( - array('foo', 'baz', 'bar', true), - array('0', '0', '0', true), - array('', 'baz', 'bar', 'The cookie name must not be empty'), - array('foo', '', 'bar', 'The cookie value must not be empty'), - array('foo', 'baz', '', 'The cookie domain must not be empty'), - array("foo\r", 'baz', '0', 'Cookie name must not cannot invalid characters: =,; \t\r\n\013\014'), - ); - } - - /** - * @dataProvider cookieValidateProvider - */ - public function testValidatesCookies($name, $value, $domain, $result) - { - $cookie = new SetCookie(array( - 'Name' => $name, - 'Value' => $value, - 'Domain' => $domain - )); - $this->assertSame($result, $cookie->validate()); - } - - public function testDoesNotMatchIp() - { - $cookie = new SetCookie(['Domain' => '192.168.16.']); - $this->assertFalse($cookie->matchesDomain('192.168.16.121')); - } - - public function testConvertsToString() - { - $t = 1382916008; - $cookie = new SetCookie([ - 'Name' => 'test', - 'Value' => '123', - 'Domain' => 'foo.com', - 'Expires' => $t, - 'Path' => '/abc', - 'HttpOnly' => true, - 'Secure' => true - ]); - $this->assertEquals( - 'test=123; Domain=foo.com; Path=/abc; Expires=Sun, 27 Oct 2013 23:20:08 GMT; Secure; HttpOnly', - (string) $cookie - ); - } - - /** - * Provides the parsed information from a cookie - * - * @return array - */ - public function cookieParserDataProvider() - { - return array( - array( - 'ASIHTTPRequestTestCookie=This+is+the+value; expires=Sat, 26-Jul-2008 17:00:42 GMT; path=/tests; domain=allseeing-i.com; PHPSESSID=6c951590e7a9359bcedde25cda73e43c; path=/";', - array( - 'Domain' => 'allseeing-i.com', - 'Path' => '/', - 'PHPSESSID' => '6c951590e7a9359bcedde25cda73e43c', - 'Max-Age' => NULL, - 'Expires' => 'Sat, 26-Jul-2008 17:00:42 GMT', - 'Secure' => NULL, - 'Discard' => NULL, - 'Name' => 'ASIHTTPRequestTestCookie', - 'Value' => 'This+is+the+value', - 'HttpOnly' => false - ) - ), - array('', []), - array('foo', []), - // Test setting a blank value for a cookie - array(array( - 'foo=', 'foo =', 'foo =;', 'foo= ;', 'foo =', 'foo= '), - array( - 'Name' => 'foo', - 'Value' => '', - 'Discard' => null, - 'Domain' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ) - ), - // Test setting a value and removing quotes - array(array( - 'foo=1', 'foo =1', 'foo =1;', 'foo=1 ;', 'foo =1', 'foo= 1', 'foo = 1 ;', 'foo="1"', 'foo="1";', 'foo= "1";'), - array( - 'Name' => 'foo', - 'Value' => '1', - 'Discard' => null, - 'Domain' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ) - ), - // Some of the following tests are based on http://framework.zend.com/svn/framework/standard/trunk/tests/Zend/Http/CookieTest.php - array( - 'justacookie=foo; domain=example.com', - array( - 'Name' => 'justacookie', - 'Value' => 'foo', - 'Domain' => 'example.com', - 'Discard' => null, - 'Expires' => null, - 'Max-Age' => null, - 'Path' => '/', - 'Secure' => null, - 'HttpOnly' => false - ) - ), - array( - 'expires=tomorrow; secure; path=/Space Out/; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=.example.com', - array( - 'Name' => 'expires', - 'Value' => 'tomorrow', - 'Domain' => '.example.com', - 'Path' => '/Space Out/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Discard' => null, - 'Secure' => true, - 'Max-Age' => null, - 'HttpOnly' => false - ) - ), - array( - 'domain=unittests; expires=Tue, 21-Nov-2006 08:33:44 GMT; domain=example.com; path=/some value/', - array( - 'Name' => 'domain', - 'Value' => 'unittests', - 'Domain' => 'example.com', - 'Path' => '/some value/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => false, - 'Discard' => null, - 'Max-Age' => null, - 'HttpOnly' => false - ) - ), - array( - 'path=indexAction; path=/; domain=.foo.com; expires=Tue, 21-Nov-2006 08:33:44 GMT', - array( - 'Name' => 'path', - 'Value' => 'indexAction', - 'Domain' => '.foo.com', - 'Path' => '/', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => false, - 'Discard' => null, - 'Max-Age' => null, - 'HttpOnly' => false - ) - ), - array( - 'secure=sha1; secure; SECURE; domain=some.really.deep.domain.com; version=1; Max-Age=86400', - array( - 'Name' => 'secure', - 'Value' => 'sha1', - 'Domain' => 'some.really.deep.domain.com', - 'Path' => '/', - 'Secure' => true, - 'Discard' => null, - 'Expires' => time() + 86400, - 'Max-Age' => 86400, - 'HttpOnly' => false, - 'version' => '1' - ) - ), - array( - 'PHPSESSID=123456789+abcd%2Cef; secure; discard; domain=.localdomain; path=/foo/baz; expires=Tue, 21-Nov-2006 08:33:44 GMT;', - array( - 'Name' => 'PHPSESSID', - 'Value' => '123456789+abcd%2Cef', - 'Domain' => '.localdomain', - 'Path' => '/foo/baz', - 'Expires' => 'Tue, 21-Nov-2006 08:33:44 GMT', - 'Secure' => true, - 'Discard' => true, - 'Max-Age' => null, - 'HttpOnly' => false - ) - ), - ); - } - - /** - * @dataProvider cookieParserDataProvider - */ - public function testParseCookie($cookie, $parsed) - { - foreach ((array) $cookie as $v) { - $c = SetCookie::fromString($v); - $p = $c->toArray(); - - if (isset($p['Expires'])) { - // Remove expires values from the assertion if they are relatively equal - if (abs($p['Expires'] != strtotime($parsed['Expires'])) < 40) { - unset($p['Expires']); - unset($parsed['Expires']); - } - } - - if (!empty($parsed)) { - foreach ($parsed as $key => $value) { - $this->assertEquals($parsed[$key], $p[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true)); - } - foreach ($p as $key => $value) { - $this->assertEquals($p[$key], $parsed[$key], 'Comparing ' . $key . ' ' . var_export($value, true) . ' : ' . var_export($parsed, true) . ' | ' . var_export($p, true)); - } - } else { - $this->assertEquals([ - 'Name' => null, - 'Value' => null, - 'Domain' => null, - 'Path' => '/', - 'Max-Age' => null, - 'Expires' => null, - 'Secure' => false, - 'Discard' => false, - 'HttpOnly' => false, - ], $p); - } - } - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php b/vendor/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php deleted file mode 100644 index b8c06f15..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/AbstractEventTest.php +++ /dev/null @@ -1,14 +0,0 @@ -getMockBuilder('GuzzleHttp\Event\AbstractEvent') - ->getMockForAbstractClass(); - $this->assertFalse($e->isPropagationStopped()); - $e->stopPropagation(); - $this->assertTrue($e->isPropagationStopped()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php b/vendor/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php deleted file mode 100644 index 50536c58..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/AbstractRequestEventTest.php +++ /dev/null @@ -1,33 +0,0 @@ -getMockBuilder('GuzzleHttp\Event\AbstractRequestEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $this->assertSame($t->client, $e->getClient()); - $this->assertSame($t->request, $e->getRequest()); - } - - public function testHasTransaction() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRequestEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $r = new \ReflectionMethod($e, 'getTransaction'); - $r->setAccessible(true); - $this->assertSame($t, $r->invoke($e)); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php b/vendor/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php deleted file mode 100644 index 6a39d8bb..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/AbstractRetryableEventTest.php +++ /dev/null @@ -1,37 +0,0 @@ -transferInfo = ['foo' => 'bar']; - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRetryableEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $e->retry(); - $this->assertTrue($e->isPropagationStopped()); - $this->assertEquals('retry', $t->state); - } - - public function testCanRetryAfterDelay() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $t->transferInfo = ['foo' => 'bar']; - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractRetryableEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $e->retry(10); - $this->assertTrue($e->isPropagationStopped()); - $this->assertEquals('retry', $t->state); - $this->assertEquals(10, $t->request->getConfig()->get('delay')); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php b/vendor/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php deleted file mode 100644 index 5313c8e7..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/AbstractTransferEventTest.php +++ /dev/null @@ -1,59 +0,0 @@ -transferInfo = ['foo' => 'bar']; - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $this->assertNull($e->getTransferInfo('baz')); - $this->assertEquals('bar', $e->getTransferInfo('foo')); - $this->assertEquals($t->transferInfo, $e->getTransferInfo()); - } - - public function testHasResponse() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $t->response = new Response(200); - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $this->assertTrue($e->hasResponse()); - $this->assertSame($t->response, $e->getResponse()); - } - - public function testCanInterceptWithResponse() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $r = new Response(200); - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $e->intercept($r); - $this->assertSame($t->response, $r); - $this->assertSame($t->response, $e->getResponse()); - $this->assertTrue($e->isPropagationStopped()); - } - - public function testReturnsNumberOfRetries() - { - $t = new Transaction(new Client(), new Request('GET', '/')); - $t->retries = 2; - $e = $this->getMockBuilder('GuzzleHttp\Event\AbstractTransferEvent') - ->setConstructorArgs([$t]) - ->getMockForAbstractClass(); - $this->assertEquals(2, $e->getRetryCount()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php b/vendor/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php deleted file mode 100644 index 469e4e25..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/BeforeEventTest.php +++ /dev/null @@ -1,26 +0,0 @@ -exception = new \Exception('foo'); - $e = new BeforeEvent($t); - $response = new Response(200); - $e->intercept($response); - $this->assertTrue($e->isPropagationStopped()); - $this->assertSame($t->response, $response); - $this->assertNull($t->exception); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/EmitterTest.php b/vendor/guzzlehttp/guzzle/tests/Event/EmitterTest.php deleted file mode 100644 index 5b7061bc..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/EmitterTest.php +++ /dev/null @@ -1,363 +0,0 @@ -emitter = new Emitter(); - $this->listener = new TestEventListener(); - } - - protected function tearDown() - { - $this->emitter = null; - $this->listener = null; - } - - public function testInitialState() - { - $this->assertEquals(array(), $this->emitter->listeners()); - } - - public function testAddListener() - { - $this->emitter->on('pre.foo', array($this->listener, 'preFoo')); - $this->emitter->on('post.foo', array($this->listener, 'postFoo')); - $this->assertTrue($this->emitter->hasListeners(self::preFoo)); - $this->assertTrue($this->emitter->hasListeners(self::preFoo)); - $this->assertCount(1, $this->emitter->listeners(self::postFoo)); - $this->assertCount(1, $this->emitter->listeners(self::postFoo)); - $this->assertCount(2, $this->emitter->listeners()); - } - - public function testGetListenersSortsByPriority() - { - $listener1 = new TestEventListener(); - $listener2 = new TestEventListener(); - $listener3 = new TestEventListener(); - $listener1->name = '1'; - $listener2->name = '2'; - $listener3->name = '3'; - - $this->emitter->on('pre.foo', array($listener1, 'preFoo'), -10); - $this->emitter->on('pre.foo', array($listener2, 'preFoo'), 10); - $this->emitter->on('pre.foo', array($listener3, 'preFoo')); - - $expected = array( - array($listener2, 'preFoo'), - array($listener3, 'preFoo'), - array($listener1, 'preFoo'), - ); - - $this->assertSame($expected, $this->emitter->listeners('pre.foo')); - } - - public function testGetAllListenersSortsByPriority() - { - $listener1 = new TestEventListener(); - $listener2 = new TestEventListener(); - $listener3 = new TestEventListener(); - $listener4 = new TestEventListener(); - $listener5 = new TestEventListener(); - $listener6 = new TestEventListener(); - - $this->emitter->on('pre.foo', [$listener1, 'preFoo'], -10); - $this->emitter->on('pre.foo', [$listener2, 'preFoo']); - $this->emitter->on('pre.foo', [$listener3, 'preFoo'], 10); - $this->emitter->on('post.foo', [$listener4, 'preFoo'], -10); - $this->emitter->on('post.foo', [$listener5, 'preFoo']); - $this->emitter->on('post.foo', [$listener6, 'preFoo'], 10); - - $expected = [ - 'pre.foo' => [[$listener3, 'preFoo'], [$listener2, 'preFoo'], [$listener1, 'preFoo']], - 'post.foo' => [[$listener6, 'preFoo'], [$listener5, 'preFoo'], [$listener4, 'preFoo']], - ]; - - $this->assertSame($expected, $this->emitter->listeners()); - } - - public function testDispatch() - { - $this->emitter->on('pre.foo', array($this->listener, 'preFoo')); - $this->emitter->on('post.foo', array($this->listener, 'postFoo')); - $this->emitter->emit(self::preFoo, $this->getEvent()); - $this->assertTrue($this->listener->preFooInvoked); - $this->assertFalse($this->listener->postFooInvoked); - $this->assertInstanceOf('GuzzleHttp\Event\EventInterface', $this->emitter->emit(self::preFoo, $this->getEvent())); - $event = $this->getEvent(); - $return = $this->emitter->emit(self::preFoo, $event); - $this->assertSame($event, $return); - } - - public function testDispatchForClosure() - { - $invoked = 0; - $listener = function () use (&$invoked) { - $invoked++; - }; - $this->emitter->on('pre.foo', $listener); - $this->emitter->on('post.foo', $listener); - $this->emitter->emit(self::preFoo, $this->getEvent()); - $this->assertEquals(1, $invoked); - } - - public function testStopEventPropagation() - { - $otherListener = new TestEventListener(); - - // postFoo() stops the propagation, so only one listener should - // be executed - // Manually set priority to enforce $this->listener to be called first - $this->emitter->on('post.foo', array($this->listener, 'postFoo'), 10); - $this->emitter->on('post.foo', array($otherListener, 'preFoo')); - $this->emitter->emit(self::postFoo, $this->getEvent()); - $this->assertTrue($this->listener->postFooInvoked); - $this->assertFalse($otherListener->postFooInvoked); - } - - public function testDispatchByPriority() - { - $invoked = array(); - $listener1 = function () use (&$invoked) { - $invoked[] = '1'; - }; - $listener2 = function () use (&$invoked) { - $invoked[] = '2'; - }; - $listener3 = function () use (&$invoked) { - $invoked[] = '3'; - }; - $this->emitter->on('pre.foo', $listener1, -10); - $this->emitter->on('pre.foo', $listener2); - $this->emitter->on('pre.foo', $listener3, 10); - $this->emitter->emit(self::preFoo, $this->getEvent()); - $this->assertEquals(array('3', '2', '1'), $invoked); - } - - public function testRemoveListener() - { - $this->emitter->on('pre.bar', [$this->listener, 'preFoo']); - $this->assertNotEmpty($this->emitter->listeners(self::preBar)); - $this->emitter->removeListener('pre.bar', [$this->listener, 'preFoo']); - $this->assertEmpty($this->emitter->listeners(self::preBar)); - $this->emitter->removeListener('notExists', [$this->listener, 'preFoo']); - } - - public function testAddSubscriber() - { - $eventSubscriber = new TestEventSubscriber(); - $this->emitter->attach($eventSubscriber); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertNotEmpty($this->emitter->listeners(self::postFoo)); - } - - public function testAddSubscriberWithMultiple() - { - $eventSubscriber = new TestEventSubscriberWithMultiple(); - $this->emitter->attach($eventSubscriber); - $listeners = $this->emitter->listeners('pre.foo'); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertCount(2, $listeners); - } - - public function testAddSubscriberWithPriorities() - { - $eventSubscriber = new TestEventSubscriber(); - $this->emitter->attach($eventSubscriber); - - $eventSubscriber = new TestEventSubscriberWithPriorities(); - $this->emitter->attach($eventSubscriber); - - $listeners = $this->emitter->listeners('pre.foo'); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertCount(2, $listeners); - $this->assertInstanceOf('GuzzleHttp\Tests\Event\TestEventSubscriberWithPriorities', $listeners[0][0]); - } - - public function testdetach() - { - $eventSubscriber = new TestEventSubscriber(); - $this->emitter->attach($eventSubscriber); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertNotEmpty($this->emitter->listeners(self::postFoo)); - $this->emitter->detach($eventSubscriber); - $this->assertEmpty($this->emitter->listeners(self::preFoo)); - $this->assertEmpty($this->emitter->listeners(self::postFoo)); - } - - public function testdetachWithPriorities() - { - $eventSubscriber = new TestEventSubscriberWithPriorities(); - $this->emitter->attach($eventSubscriber); - $this->assertNotEmpty($this->emitter->listeners(self::preFoo)); - $this->assertNotEmpty($this->emitter->listeners(self::postFoo)); - $this->emitter->detach($eventSubscriber); - $this->assertEmpty($this->emitter->listeners(self::preFoo)); - $this->assertEmpty($this->emitter->listeners(self::postFoo)); - } - - public function testEventReceivesEventNameAsArgument() - { - $listener = new TestWithDispatcher(); - $this->emitter->on('test', array($listener, 'foo')); - $this->assertNull($listener->name); - $this->emitter->emit('test', $this->getEvent()); - $this->assertEquals('test', $listener->name); - } - - /** - * @see https://bugs.php.net/bug.php?id=62976 - * - * This bug affects: - * - The PHP 5.3 branch for versions < 5.3.18 - * - The PHP 5.4 branch for versions < 5.4.8 - * - The PHP 5.5 branch is not affected - */ - public function testWorkaroundForPhpBug62976() - { - $dispatcher = new Emitter(); - $dispatcher->on('bug.62976', new CallableClass()); - $dispatcher->removeListener('bug.62976', function () {}); - $this->assertNotEmpty($dispatcher->listeners('bug.62976')); - } - - public function testRegistersEventsOnce() - { - $this->emitter->once('pre.foo', array($this->listener, 'preFoo')); - $this->emitter->on('pre.foo', array($this->listener, 'preFoo')); - $this->assertCount(2, $this->emitter->listeners(self::preFoo)); - $this->emitter->emit(self::preFoo, $this->getEvent()); - $this->assertTrue($this->listener->preFooInvoked); - $this->assertCount(1, $this->emitter->listeners(self::preFoo)); - } - - public function testReturnsEmptyArrayForNonExistentEvent() - { - $this->assertEquals([], $this->emitter->listeners('doesnotexist')); - } - - public function testCanAddFirstAndLastListeners() - { - $b = ''; - $this->emitter->on('foo', function () use (&$b) { $b .= 'a'; }, 'first'); // 1 - $this->emitter->on('foo', function () use (&$b) { $b .= 'b'; }, 'last'); // 0 - $this->emitter->on('foo', function () use (&$b) { $b .= 'c'; }, 'first'); // 2 - $this->emitter->on('foo', function () use (&$b) { $b .= 'd'; }, 'first'); // 3 - $this->emitter->on('foo', function () use (&$b) { $b .= 'e'; }, 'first'); // 4 - $this->emitter->on('foo', function () use (&$b) { $b .= 'f'; }); // 0 - $this->emitter->emit('foo', $this->getEvent()); - $this->assertEquals('edcabf', $b); - } - - /** - * @return \GuzzleHttp\Event\EventInterface - */ - private function getEvent() - { - return $this->getMockBuilder('GuzzleHttp\Event\AbstractEvent') - ->getMockForAbstractClass(); - } -} - -class CallableClass -{ - public function __invoke() - { - } -} - -class TestEventListener -{ - public $preFooInvoked = false; - public $postFooInvoked = false; - - /* Listener methods */ - - public function preFoo(EventInterface $e) - { - $this->preFooInvoked = true; - } - - public function postFoo(EventInterface $e) - { - $this->postFooInvoked = true; - - $e->stopPropagation(); - } - - /** - * @expectedException \PHPUnit_Framework_Error_Deprecated - */ - public function testHasDeprecatedAddListener() - { - $emitter = new Emitter(); - $emitter->addListener('foo', function () {}); - } - - /** - * @expectedException \PHPUnit_Framework_Error_Deprecated - */ - public function testHasDeprecatedAddSubscriber() - { - $emitter = new Emitter(); - $emitter->addSubscriber('foo', new TestEventSubscriber()); - } -} - -class TestWithDispatcher -{ - public $name; - - public function foo(EventInterface $e, $name) - { - $this->name = $name; - } -} - -class TestEventSubscriber extends TestEventListener implements SubscriberInterface -{ - public function getEvents() - { - return [ - 'pre.foo' => ['preFoo'], - 'post.foo' => ['postFoo'] - ]; - } -} - -class TestEventSubscriberWithPriorities extends TestEventListener implements SubscriberInterface -{ - public function getEvents() - { - return [ - 'pre.foo' => ['preFoo', 10], - 'post.foo' => ['postFoo'] - ]; - } -} - -class TestEventSubscriberWithMultiple extends TestEventListener implements SubscriberInterface -{ - public function getEvents() - { - return ['pre.foo' => [['preFoo', 10],['preFoo', 20]]]; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php b/vendor/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php deleted file mode 100644 index e91b7f0c..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/ErrorEventTest.php +++ /dev/null @@ -1,23 +0,0 @@ -request); - $t->exception = $except; - $e = new ErrorEvent($t); - $this->assertSame($e->getException(), $t->exception); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php b/vendor/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php deleted file mode 100644 index 47099187..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/HasEmitterTraitTest.php +++ /dev/null @@ -1,27 +0,0 @@ -getMockBuilder('GuzzleHttp\Tests\Event\AbstractHasEmitter') - ->getMockForAbstractClass(); - - $result = $mock->getEmitter(); - $this->assertInstanceOf('GuzzleHttp\Event\EmitterInterface', $result); - $result2 = $mock->getEmitter(); - $this->assertSame($result, $result2); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php b/vendor/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php deleted file mode 100644 index 0b5d348f..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/ListenerAttacherTraitTest.php +++ /dev/null @@ -1,92 +0,0 @@ -listeners = $this->prepareListeners($args, ['foo', 'bar']); - $this->attachListeners($this, $this->listeners); - } -} - -class ListenerAttacherTraitTest extends \PHPUnit_Framework_TestCase -{ - public function testRegistersEvents() - { - $fn = function () {}; - $o = new ObjectWithEvents([ - 'foo' => $fn, - 'bar' => $fn, - ]); - - $this->assertEquals([ - ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false], - ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false], - ], $o->listeners); - - $this->assertCount(1, $o->getEmitter()->listeners('foo')); - $this->assertCount(1, $o->getEmitter()->listeners('bar')); - } - - public function testRegistersEventsWithPriorities() - { - $fn = function () {}; - $o = new ObjectWithEvents([ - 'foo' => ['fn' => $fn, 'priority' => 99, 'once' => true], - 'bar' => ['fn' => $fn, 'priority' => 50], - ]); - - $this->assertEquals([ - ['name' => 'foo', 'fn' => $fn, 'priority' => 99, 'once' => true], - ['name' => 'bar', 'fn' => $fn, 'priority' => 50, 'once' => false], - ], $o->listeners); - } - - public function testRegistersMultipleEvents() - { - $fn = function () {}; - $eventArray = [['fn' => $fn], ['fn' => $fn]]; - $o = new ObjectWithEvents([ - 'foo' => $eventArray, - 'bar' => $eventArray, - ]); - - $this->assertEquals([ - ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false], - ['name' => 'foo', 'fn' => $fn, 'priority' => 0, 'once' => false], - ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false], - ['name' => 'bar', 'fn' => $fn, 'priority' => 0, 'once' => false], - ], $o->listeners); - - $this->assertCount(2, $o->getEmitter()->listeners('foo')); - $this->assertCount(2, $o->getEmitter()->listeners('bar')); - } - - public function testRegistersEventsWithOnce() - { - $called = 0; - $fn = function () use (&$called) { $called++; }; - $o = new ObjectWithEvents(['foo' => ['fn' => $fn, 'once' => true]]); - $ev = $this->getMock('GuzzleHttp\Event\EventInterface'); - $o->getEmitter()->emit('foo', $ev); - $o->getEmitter()->emit('foo', $ev); - $this->assertEquals(1, $called); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEvents() - { - new ObjectWithEvents(['foo' => 'bar']); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php b/vendor/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php deleted file mode 100644 index 664f8b6b..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/ProgressEventTest.php +++ /dev/null @@ -1,25 +0,0 @@ -assertSame($t->request, $p->getRequest()); - $this->assertSame($t->client, $p->getClient()); - $this->assertEquals(2, $p->downloadSize); - $this->assertEquals(1, $p->downloaded); - $this->assertEquals(3, $p->uploadSize); - $this->assertEquals(0, $p->uploaded); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php b/vendor/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php deleted file mode 100644 index b3b96660..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Event/RequestEventsTest.php +++ /dev/null @@ -1,74 +0,0 @@ - [$cb]]], - [ - ['complete' => $cb], - ['complete'], - $cb, - ['complete' => [$cb, $cb]] - ], - [ - ['prepare' => []], - ['error', 'foo'], - $cb, - [ - 'prepare' => [], - 'error' => [$cb], - 'foo' => [$cb] - ] - ], - [ - ['prepare' => []], - ['prepare'], - $cb, - [ - 'prepare' => [$cb] - ] - ], - [ - ['prepare' => ['fn' => $cb]], - ['prepare'], $cb, - [ - 'prepare' => [ - ['fn' => $cb], - $cb - ] - ] - ], - ]; - } - - /** - * @dataProvider prepareEventProvider - */ - public function testConvertsEventArrays( - array $in, - array $events, - $add, - array $out - ) { - $result = RequestEvents::convertEventArray($in, $events, $add); - $this->assertEquals($out, $result); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEventFormat() - { - RequestEvents::convertEventArray(['foo' => false], ['foo'], []); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php b/vendor/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php deleted file mode 100644 index 4ff9bfb6..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Exception/ParseExceptionTest.php +++ /dev/null @@ -1,20 +0,0 @@ -assertSame($res, $e->getResponse()); - $this->assertEquals('foo', $e->getMessage()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php b/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php deleted file mode 100644 index bea9077b..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Exception/RequestExceptionTest.php +++ /dev/null @@ -1,83 +0,0 @@ -assertSame($req, $e->getRequest()); - $this->assertSame($res, $e->getResponse()); - $this->assertTrue($e->hasResponse()); - $this->assertEquals('foo', $e->getMessage()); - } - - public function testCreatesGenerateException() - { - $e = RequestException::create(new Request('GET', '/')); - $this->assertEquals('Error completing request', $e->getMessage()); - $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - } - - public function testCreatesClientErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(400)); - $this->assertEquals( - 'Client error response [url] / [status code] 400 [reason phrase] Bad Request', - $e->getMessage() - ); - $this->assertInstanceOf('GuzzleHttp\Exception\ClientException', $e); - } - - public function testCreatesServerErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(500)); - $this->assertEquals( - 'Server error response [url] / [status code] 500 [reason phrase] Internal Server Error', - $e->getMessage() - ); - $this->assertInstanceOf('GuzzleHttp\Exception\ServerException', $e); - } - - public function testCreatesGenericErrorResponseException() - { - $e = RequestException::create(new Request('GET', '/'), new Response(600)); - $this->assertEquals( - 'Unsuccessful response [url] / [status code] 600 [reason phrase] ', - $e->getMessage() - ); - $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - } - - public function testHasStatusCodeAsExceptionCode() { - $e = RequestException::create(new Request('GET', '/'), new Response(442)); - $this->assertEquals(442, $e->getCode()); - } - - public function testWrapsRequestExceptions() - { - $e = new \Exception('foo'); - $r = new Request('GET', 'http://www.oo.com'); - $ex = RequestException::wrapException($r, $e); - $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $ex); - $this->assertSame($e, $ex->getPrevious()); - } - - public function testWrapsConnectExceptions() - { - $e = new ConnectException('foo'); - $r = new Request('GET', 'http://www.oo.com'); - $ex = RequestException::wrapException($r, $e); - $this->assertInstanceOf('GuzzleHttp\Exception\ConnectException', $ex); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php b/vendor/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php deleted file mode 100644 index 51b97425..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Exception/XmlParseExceptionTest.php +++ /dev/null @@ -1,19 +0,0 @@ -assertSame($error, $e->getError()); - $this->assertEquals('foo', $e->getMessage()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/IntegrationTest.php b/vendor/guzzlehttp/guzzle/tests/IntegrationTest.php deleted file mode 100644 index e26c64d9..00000000 --- a/vendor/guzzlehttp/guzzle/tests/IntegrationTest.php +++ /dev/null @@ -1,123 +0,0 @@ -createRequest( - 'GET', - Server::$url, - [ - 'timeout' => 1, - 'connect_timeout' => 1, - 'proxy' => 'http://127.0.0.1:123/foo' - ] - ); - - $events = []; - $fn = function(AbstractTransferEvent $event) use (&$events) { - $events[] = [ - get_class($event), - $event->hasResponse(), - $event->getResponse() - ]; - }; - - $pool = new Pool($c, [$r], [ - 'error' => $fn, - 'end' => $fn - ]); - - $pool->wait(); - - $this->assertCount(2, $events); - $this->assertEquals('GuzzleHttp\Event\ErrorEvent', $events[0][0]); - $this->assertFalse($events[0][1]); - $this->assertNull($events[0][2]); - - $this->assertEquals('GuzzleHttp\Event\EndEvent', $events[1][0]); - $this->assertFalse($events[1][1]); - $this->assertNull($events[1][2]); - } - - /** - * @issue https://github.com/guzzle/guzzle/issues/866 - */ - public function testProperyGetsTransferStats() - { - $transfer = []; - Server::enqueue([new Response(200)]); - $c = new Client(); - $response = $c->get(Server::$url . '/foo', [ - 'events' => [ - 'end' => function (EndEvent $e) use (&$transfer) { - $transfer = $e->getTransferInfo(); - } - ] - ]); - $this->assertEquals(Server::$url . '/foo', $response->getEffectiveUrl()); - $this->assertNotEmpty($transfer); - $this->assertArrayHasKey('url', $transfer); - } - - public function testNestedFutureResponsesAreResolvedWhenSending() - { - $c = new Client(); - $total = 3; - Server::enqueue([ - new Response(200), - new Response(201), - new Response(202) - ]); - $c->getEmitter()->on( - 'complete', - function (CompleteEvent $e) use (&$total) { - if (--$total) { - $e->retry(); - } - } - ); - $response = $c->get(Server::$url); - $this->assertEquals(202, $response->getStatusCode()); - $this->assertEquals('GuzzleHttp\Message\Response', get_class($response)); - } - - public function testNestedFutureErrorsAreResolvedWhenSending() - { - $c = new Client(); - $total = 3; - Server::enqueue([ - new Response(500), - new Response(501), - new Response(502) - ]); - $c->getEmitter()->on( - 'error', - function (ErrorEvent $e) use (&$total) { - if (--$total) { - $e->retry(); - } - } - ); - try { - $c->get(Server::$url); - $this->fail('Did not throw!'); - } catch (RequestException $e) { - $this->assertEquals(502, $e->getResponse()->getStatusCode()); - } - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php b/vendor/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php deleted file mode 100644 index f02a576f..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Message/AbstractMessageTest.php +++ /dev/null @@ -1,269 +0,0 @@ -assertEquals(1.1, $m->getProtocolVersion()); - } - - public function testHasHeaders() - { - $m = new Request('GET', 'http://foo.com'); - $this->assertFalse($m->hasHeader('foo')); - $m->addHeader('foo', 'bar'); - $this->assertTrue($m->hasHeader('foo')); - } - - public function testInitializesMessageWithProtocolVersionOption() - { - $m = new Request('GET', '/', [], null, [ - 'protocol_version' => '10' - ]); - $this->assertEquals(10, $m->getProtocolVersion()); - } - - public function testHasBody() - { - $m = new Request('GET', 'http://foo.com'); - $this->assertNull($m->getBody()); - $s = Stream::factory('test'); - $m->setBody($s); - $this->assertSame($s, $m->getBody()); - $this->assertFalse($m->hasHeader('Content-Length')); - } - - public function testCanRemoveBodyBySettingToNullAndRemovesCommonBodyHeaders() - { - $m = new Request('GET', 'http://foo.com'); - $m->setBody(Stream::factory('foo')); - $m->setHeader('Content-Length', 3); - $m->setHeader('Transfer-Encoding', 'chunked'); - $m->setBody(null); - $this->assertNull($m->getBody()); - $this->assertFalse($m->hasHeader('Content-Length')); - $this->assertFalse($m->hasHeader('Transfer-Encoding')); - } - - public function testCastsToString() - { - $m = new Request('GET', 'http://foo.com'); - $m->setHeader('foo', 'bar'); - $m->setBody(Stream::factory('baz')); - $this->assertEquals("GET / HTTP/1.1\r\nHost: foo.com\r\nfoo: bar\r\n\r\nbaz", (string) $m); - } - - public function parseParamsProvider() - { - $res1 = array( - array( - '', - 'rel' => 'front', - 'type' => 'image/jpeg', - ), - array( - '', - 'rel' => 'back', - 'type' => 'image/jpeg', - ), - ); - - return array( - array( - '; rel="front"; type="image/jpeg", ; rel=back; type="image/jpeg"', - $res1 - ), - array( - '; rel="front"; type="image/jpeg",; rel=back; type="image/jpeg"', - $res1 - ), - array( - 'foo="baz"; bar=123, boo, test="123", foobar="foo;bar"', - array( - array('foo' => 'baz', 'bar' => '123'), - array('boo'), - array('test' => '123'), - array('foobar' => 'foo;bar') - ) - ), - array( - '; rel="side"; type="image/jpeg",; rel=side; type="image/jpeg"', - array( - array('', 'rel' => 'side', 'type' => 'image/jpeg'), - array('', 'rel' => 'side', 'type' => 'image/jpeg') - ) - ), - array( - '', - array() - ) - ); - } - - /** - * @dataProvider parseParamsProvider - */ - public function testParseParams($header, $result) - { - $request = new Request('GET', '/', ['foo' => $header]); - $this->assertEquals($result, Request::parseHeader($request, 'foo')); - } - - public function testAddsHeadersWhenNotPresent() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('foo', 'bar'); - $this->assertInternalType('string', $h->getHeader('foo')); - $this->assertEquals('bar', $h->getHeader('foo')); - } - - public function testAddsHeadersWhenPresentSameCase() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('foo', 'bar'); - $h->addHeader('foo', 'baz'); - $this->assertEquals('bar, baz', $h->getHeader('foo')); - $this->assertEquals(['bar', 'baz'], $h->getHeaderAsArray('foo')); - } - - public function testAddsMultipleHeaders() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeaders([ - 'foo' => ' bar', - 'baz' => [' bam ', 'boo'] - ]); - $this->assertEquals([ - 'foo' => ['bar'], - 'baz' => ['bam', 'boo'], - 'Host' => ['foo.com'] - ], $h->getHeaders()); - } - - public function testAddsHeadersWhenPresentDifferentCase() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('Foo', 'bar'); - $h->addHeader('fOO', 'baz'); - $this->assertEquals('bar, baz', $h->getHeader('foo')); - } - - public function testAddsHeadersWithArray() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('Foo', ['bar', 'baz']); - $this->assertEquals('bar, baz', $h->getHeader('foo')); - } - - public function testGetHeadersReturnsAnArrayOfOverTheWireHeaderValues() - { - $h = new Request('GET', 'http://foo.com'); - $h->addHeader('foo', 'bar'); - $h->addHeader('Foo', 'baz'); - $h->addHeader('boO', 'test'); - $result = $h->getHeaders(); - $this->assertInternalType('array', $result); - $this->assertArrayHasKey('Foo', $result); - $this->assertArrayNotHasKey('foo', $result); - $this->assertArrayHasKey('boO', $result); - $this->assertEquals(['bar', 'baz'], $result['Foo']); - $this->assertEquals(['test'], $result['boO']); - } - - public function testSetHeaderOverwritesExistingValues() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 'bar'); - $this->assertEquals('bar', $h->getHeader('foo')); - $h->setHeader('Foo', 'baz'); - $this->assertEquals('baz', $h->getHeader('foo')); - $this->assertArrayHasKey('Foo', $h->getHeaders()); - } - - public function testSetHeaderOverwritesExistingValuesUsingHeaderArray() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', ['bar']); - $this->assertEquals('bar', $h->getHeader('foo')); - } - - public function testSetHeaderOverwritesExistingValuesUsingArray() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', ['bar']); - $this->assertEquals('bar', $h->getHeader('foo')); - } - - public function testSetHeadersOverwritesAllHeaders() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 'bar'); - $h->setHeaders(['foo' => 'a', 'boo' => 'b']); - $this->assertEquals(['foo' => ['a'], 'boo' => ['b']], $h->getHeaders()); - } - - public function testChecksIfCaseInsensitiveHeaderIsPresent() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 'bar'); - $this->assertTrue($h->hasHeader('foo')); - $this->assertTrue($h->hasHeader('Foo')); - $h->setHeader('fOo', 'bar'); - $this->assertTrue($h->hasHeader('Foo')); - } - - public function testRemovesHeaders() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 'bar'); - $h->removeHeader('foo'); - $this->assertFalse($h->hasHeader('foo')); - $h->setHeader('Foo', 'bar'); - $h->removeHeader('FOO'); - $this->assertFalse($h->hasHeader('foo')); - } - - public function testReturnsCorrectTypeWhenMissing() - { - $h = new Request('GET', 'http://foo.com'); - $this->assertInternalType('string', $h->getHeader('foo')); - $this->assertInternalType('array', $h->getHeaderAsArray('foo')); - } - - public function testSetsIntegersAndFloatsAsHeaders() - { - $h = new Request('GET', 'http://foo.com'); - $h->setHeader('foo', 10); - $h->setHeader('bar', 10.5); - $h->addHeader('foo', 10); - $h->addHeader('bar', 10.5); - $this->assertSame('10, 10', $h->getHeader('foo')); - $this->assertSame('10.5, 10.5', $h->getHeader('bar')); - } - - public function testGetsResponseStartLine() - { - $m = new Response(200); - $this->assertEquals('HTTP/1.1 200 OK', Response::getStartLine($m)); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsWhenMessageIsUnknown() - { - $m = $this->getMockBuilder('GuzzleHttp\Message\AbstractMessage') - ->getMockForAbstractClass(); - AbstractMessage::getStartLine($m); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php b/vendor/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php deleted file mode 100644 index 771631d5..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Message/FutureResponseTest.php +++ /dev/null @@ -1,160 +0,0 @@ -foo; - } - - public function testDoesTheSameAsResponseWhenDereferenced() - { - $str = Stream::factory('foo'); - $response = new Response(200, ['Foo' => 'bar'], $str); - $future = MockTest::createFuture(function () use ($response) { - return $response; - }); - $this->assertFalse($this->readAttribute($future, 'isRealized')); - $this->assertEquals(200, $future->getStatusCode()); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - // Deref again does nothing. - $future->wait(); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - $this->assertEquals('bar', $future->getHeader('Foo')); - $this->assertEquals(['bar'], $future->getHeaderAsarray('Foo')); - $this->assertSame($response->getHeaders(), $future->getHeaders()); - $this->assertSame( - $response->getBody(), - $future->getBody() - ); - $this->assertSame( - $response->getProtocolVersion(), - $future->getProtocolVersion() - ); - $this->assertSame( - $response->getEffectiveUrl(), - $future->getEffectiveUrl() - ); - $future->setEffectiveUrl('foo'); - $this->assertEquals('foo', $response->getEffectiveUrl()); - $this->assertSame( - $response->getReasonPhrase(), - $future->getReasonPhrase() - ); - - $this->assertTrue($future->hasHeader('foo')); - - $future->removeHeader('Foo'); - $this->assertFalse($future->hasHeader('foo')); - $this->assertFalse($response->hasHeader('foo')); - - $future->setBody(Stream::factory('true')); - $this->assertEquals('true', (string) $response->getBody()); - $this->assertTrue($future->json()); - $this->assertSame((string) $response, (string) $future); - - $future->setBody(Stream::factory('c')); - $this->assertEquals('c', (string) $future->xml()->b); - - $future->addHeader('a', 'b'); - $this->assertEquals('b', $future->getHeader('a')); - - $future->addHeaders(['a' => '2']); - $this->assertEquals('b, 2', $future->getHeader('a')); - - $future->setHeader('a', '2'); - $this->assertEquals('2', $future->getHeader('a')); - - $future->setHeaders(['a' => '3']); - $this->assertEquals(['a' => ['3']], $future->getHeaders()); - } - - public function testCanDereferenceManually() - { - $response = new Response(200, ['Foo' => 'bar']); - $future = MockTest::createFuture(function () use ($response) { - return $response; - }); - $this->assertSame($response, $future->wait()); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - } - - public function testCanCancel() - { - $c = false; - $deferred = new Deferred(); - $future = new FutureResponse( - $deferred->promise(), - function () {}, - function () use (&$c) { - $c = true; - return true; - } - ); - - $this->assertFalse($this->readAttribute($future, 'isRealized')); - $future->cancel(); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - $future->cancel(); - } - - public function testCanCancelButReturnsFalseForNoCancelFunction() - { - $future = MockTest::createFuture(function () {}); - $future->cancel(); - $this->assertTrue($this->readAttribute($future, 'isRealized')); - } - - /** - * @expectedException \GuzzleHttp\Ring\Exception\CancelledFutureAccessException - */ - public function testAccessingCancelledResponseThrows() - { - $future = MockTest::createFuture(function () {}); - $future->cancel(); - $future->getStatusCode(); - } - - public function testExceptionInToStringTriggersError() - { - $future = MockTest::createFuture(function () { - throw new \Exception('foo'); - }); - $err = ''; - set_error_handler(function () use (&$err) { - $err = func_get_args()[1]; - }); - echo $future; - restore_error_handler(); - $this->assertContains('foo', $err); - } - - public function testProxiesSetters() - { - $str = Stream::factory('foo'); - $response = new Response(200, ['Foo' => 'bar'], $str); - $future = MockTest::createFuture(function () use ($response) { - return $response; - }); - - $future->setStatusCode(202); - $this->assertEquals(202, $future->getStatusCode()); - $this->assertEquals(202, $response->getStatusCode()); - - $future->setReasonPhrase('foo'); - $this->assertEquals('foo', $future->getReasonPhrase()); - $this->assertEquals('foo', $response->getReasonPhrase()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php b/vendor/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php deleted file mode 100644 index 390f0103..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Message/MessageFactoryTest.php +++ /dev/null @@ -1,601 +0,0 @@ -createResponse(200, ['foo' => 'bar'], 'test', [ - 'protocol_version' => 1.0 - ]); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals(['foo' => ['bar']], $response->getHeaders()); - $this->assertEquals('test', $response->getBody()); - $this->assertEquals(1.0, $response->getProtocolVersion()); - } - - public function testCreatesRequestFromMessage() - { - $f = new MessageFactory(); - $req = $f->fromMessage("GET / HTTP/1.1\r\nBaz: foo\r\n\r\n"); - $this->assertEquals('GET', $req->getMethod()); - $this->assertEquals('/', $req->getPath()); - $this->assertEquals('foo', $req->getHeader('Baz')); - $this->assertNull($req->getBody()); - } - - public function testCreatesRequestFromMessageWithBody() - { - $req = (new MessageFactory())->fromMessage("GET / HTTP/1.1\r\nBaz: foo\r\n\r\ntest"); - $this->assertEquals('test', $req->getBody()); - } - - public function testCreatesRequestWithPostBody() - { - $req = (new MessageFactory())->createRequest('GET', 'http://www.foo.com', ['body' => ['abc' => '123']]); - $this->assertEquals('abc=123', $req->getBody()); - } - - public function testCreatesRequestWithPostBodyScalars() - { - $req = (new MessageFactory())->createRequest( - 'GET', - 'http://www.foo.com', - ['body' => [ - 'abc' => true, - '123' => false, - 'foo' => null, - 'baz' => 10, - 'bam' => 1.5, - 'boo' => [1]] - ] - ); - $this->assertEquals( - 'abc=1&123=&foo&baz=10&bam=1.5&boo%5B0%5D=1', - (string) $req->getBody() - ); - } - - public function testCreatesRequestWithPostBodyAndPostFiles() - { - $pf = fopen(__FILE__, 'r'); - $pfi = new PostFile('ghi', 'abc', __FILE__); - $req = (new MessageFactory())->createRequest('GET', 'http://www.foo.com', [ - 'body' => [ - 'abc' => '123', - 'def' => $pf, - 'ghi' => $pfi - ] - ]); - $this->assertInstanceOf('GuzzleHttp\Post\PostBody', $req->getBody()); - $s = (string) $req; - $this->assertContains('testCreatesRequestWithPostBodyAndPostFiles', $s); - $this->assertContains('multipart/form-data', $s); - $this->assertTrue(in_array($pfi, $req->getBody()->getFiles(), true)); - } - - public function testCreatesResponseFromMessage() - { - $response = (new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest"); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('OK', $response->getReasonPhrase()); - $this->assertEquals('4', $response->getHeader('Content-Length')); - $this->assertEquals('test', $response->getBody(true)); - } - - public function testCanCreateHeadResponses() - { - $response = (new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\n"); - $this->assertEquals(200, $response->getStatusCode()); - $this->assertEquals('OK', $response->getReasonPhrase()); - $this->assertEquals(null, $response->getBody()); - $this->assertEquals('4', $response->getHeader('Content-Length')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testFactoryRequiresMessageForRequest() - { - (new MessageFactory())->fromMessage(''); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage foo - */ - public function testValidatesOptionsAreImplemented() - { - (new MessageFactory())->createRequest('GET', 'http://test.com', ['foo' => 'bar']); - } - - public function testOptionsAddsRequestOptions() - { - $request = (new MessageFactory())->createRequest( - 'GET', 'http://test.com', ['config' => ['baz' => 'bar']] - ); - $this->assertEquals('bar', $request->getConfig()->get('baz')); - } - - public function testCanDisableRedirects() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['allow_redirects' => false]); - $this->assertEmpty($request->getEmitter()->listeners('complete')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesRedirects() - { - (new MessageFactory())->createRequest('GET', '/', ['allow_redirects' => 'foo']); - } - - public function testCanEnableStrictRedirectsAndSpecifyMax() - { - $request = (new MessageFactory())->createRequest('GET', '/', [ - 'allow_redirects' => ['max' => 10, 'strict' => true] - ]); - $this->assertTrue($request->getConfig()['redirect']['strict']); - $this->assertEquals(10, $request->getConfig()['redirect']['max']); - } - - public function testCanAddCookiesFromHash() - { - $request = (new MessageFactory())->createRequest('GET', 'http://www.test.com/', [ - 'cookies' => ['Foo' => 'Bar'] - ]); - $cookies = null; - foreach ($request->getEmitter()->listeners('before') as $l) { - if ($l[0] instanceof Cookie) { - $cookies = $l[0]; - break; - } - } - if (!$cookies) { - $this->fail('Did not add cookie listener'); - } else { - $this->assertCount(1, $cookies->getCookieJar()); - } - } - - public function testAddsCookieUsingTrue() - { - $factory = new MessageFactory(); - $request1 = $factory->createRequest('GET', '/', ['cookies' => true]); - $request2 = $factory->createRequest('GET', '/', ['cookies' => true]); - $listeners = function ($r) { - return array_filter($r->getEmitter()->listeners('before'), function ($l) { - return $l[0] instanceof Cookie; - }); - }; - $this->assertSame($listeners($request1), $listeners($request2)); - } - - public function testAddsCookieFromCookieJar() - { - $jar = new CookieJar(); - $request = (new MessageFactory())->createRequest('GET', '/', ['cookies' => $jar]); - foreach ($request->getEmitter()->listeners('before') as $l) { - if ($l[0] instanceof Cookie) { - $this->assertSame($jar, $l[0]->getCookieJar()); - } - } - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesCookies() - { - (new MessageFactory())->createRequest('GET', '/', ['cookies' => 'baz']); - } - - public function testCanAddQuery() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'query' => ['Foo' => 'Bar'] - ]); - $this->assertEquals('Bar', $request->getQuery()->get('Foo')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesQuery() - { - (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'query' => 'foo' - ]); - } - - public function testCanSetDefaultQuery() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com?test=abc', [ - 'query' => ['Foo' => 'Bar', 'test' => 'def'] - ]); - $this->assertEquals('Bar', $request->getQuery()->get('Foo')); - $this->assertEquals('abc', $request->getQuery()->get('test')); - } - - public function testCanSetDefaultQueryWithObject() - { - $request = (new MessageFactory)->createRequest( - 'GET', - 'http://foo.com?test=abc', [ - 'query' => new Query(['Foo' => 'Bar', 'test' => 'def']) - ] - ); - $this->assertEquals('Bar', $request->getQuery()->get('Foo')); - $this->assertEquals('abc', $request->getQuery()->get('test')); - } - - public function testCanAddBasicAuth() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'auth' => ['michael', 'test'] - ]); - $this->assertTrue($request->hasHeader('Authorization')); - } - - public function testCanAddDigestAuth() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'auth' => ['michael', 'test', 'digest'] - ]); - $this->assertEquals('michael:test', $request->getConfig()->getPath('curl/' . CURLOPT_USERPWD)); - $this->assertEquals(CURLAUTH_DIGEST, $request->getConfig()->getPath('curl/' . CURLOPT_HTTPAUTH)); - } - - public function testCanDisableAuth() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'auth' => false - ]); - $this->assertFalse($request->hasHeader('Authorization')); - } - - public function testCanSetCustomAuth() - { - $request = (new MessageFactory())->createRequest('GET', 'http://foo.com', [ - 'auth' => 'foo' - ]); - $this->assertEquals('foo', $request->getConfig()['auth']); - } - - public function testCanAddEvents() - { - $foo = null; - $client = new Client(); - $client->getEmitter()->attach(new Mock([new Response(200)])); - $client->get('http://test.com', [ - 'events' => [ - 'before' => function () use (&$foo) { $foo = true; } - ] - ]); - $this->assertTrue($foo); - } - - public function testCanAddEventsWithPriority() - { - $foo = null; - $client = new Client(); - $client->getEmitter()->attach(new Mock(array(new Response(200)))); - $request = $client->createRequest('GET', 'http://test.com', [ - 'events' => [ - 'before' => [ - 'fn' => function () use (&$foo) { $foo = true; }, - 'priority' => 123 - ] - ] - ]); - $client->send($request); - $this->assertTrue($foo); - $l = $this->readAttribute($request->getEmitter(), 'listeners'); - $this->assertArrayHasKey(123, $l['before']); - } - - public function testCanAddEventsOnce() - { - $foo = 0; - $client = new Client(); - $client->getEmitter()->attach(new Mock([ - new Response(200), - new Response(200), - ])); - $fn = function () use (&$foo) { ++$foo; }; - $request = $client->createRequest('GET', 'http://test.com', [ - 'events' => ['before' => ['fn' => $fn, 'once' => true]] - ]); - $client->send($request); - $this->assertEquals(1, $foo); - $client->send($request); - $this->assertEquals(1, $foo); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEventContainsFn() - { - $client = new Client(['base_url' => 'http://test.com']); - $client->createRequest('GET', '/', ['events' => ['before' => ['foo' => 'bar']]]); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEventIsArray() - { - $client = new Client(['base_url' => 'http://test.com']); - $client->createRequest('GET', '/', ['events' => ['before' => '123']]); - } - - public function testCanAddSubscribers() - { - $mock = new Mock([new Response(200)]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->get('http://test.com', ['subscribers' => [$mock]]); - } - - public function testCanDisableExceptions() - { - $client = new Client(); - $this->assertEquals(500, $client->get('http://test.com', [ - 'subscribers' => [new Mock([new Response(500)])], - 'exceptions' => false - ])->getStatusCode()); - } - - public function testCanChangeSaveToLocation() - { - $saveTo = Stream::factory(); - $request = (new MessageFactory())->createRequest('GET', '/', ['save_to' => $saveTo]); - $this->assertSame($saveTo, $request->getConfig()->get('save_to')); - } - - public function testCanSetProxy() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['proxy' => '192.168.16.121']); - $this->assertEquals('192.168.16.121', $request->getConfig()->get('proxy')); - } - - public function testCanSetHeadersOption() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['headers' => ['Foo' => 'Bar']]); - $this->assertEquals('Bar', (string) $request->getHeader('Foo')); - } - - public function testCanSetHeaders() - { - $request = (new MessageFactory())->createRequest('GET', '/', [ - 'headers' => ['Foo' => ['Baz', 'Bar'], 'Test' => '123'] - ]); - $this->assertEquals('Baz, Bar', $request->getHeader('Foo')); - $this->assertEquals('123', $request->getHeader('Test')); - } - - public function testCanSetTimeoutOption() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['timeout' => 1.5]); - $this->assertEquals(1.5, $request->getConfig()->get('timeout')); - } - - public function testCanSetConnectTimeoutOption() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['connect_timeout' => 1.5]); - $this->assertEquals(1.5, $request->getConfig()->get('connect_timeout')); - } - - public function testCanSetDebug() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['debug' => true]); - $this->assertTrue($request->getConfig()->get('debug')); - } - - public function testCanSetVerifyToOff() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => false]); - $this->assertFalse($request->getConfig()->get('verify')); - } - - public function testCanSetVerifyToOn() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => true]); - $this->assertTrue($request->getConfig()->get('verify')); - } - - public function testCanSetVerifyToPath() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['verify' => '/foo.pem']); - $this->assertEquals('/foo.pem', $request->getConfig()->get('verify')); - } - - public function inputValidation() - { - return array_map(function ($option) { return array($option); }, array( - 'headers', 'events', 'subscribers', 'params' - )); - } - - /** - * @dataProvider inputValidation - * @expectedException \InvalidArgumentException - */ - public function testValidatesInput($option) - { - (new MessageFactory())->createRequest('GET', '/', [$option => 'foo']); - } - - public function testCanAddSslKey() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['ssl_key' => '/foo.pem']); - $this->assertEquals('/foo.pem', $request->getConfig()->get('ssl_key')); - } - - public function testCanAddSslKeyPassword() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['ssl_key' => ['/foo.pem', 'bar']]); - $this->assertEquals(['/foo.pem', 'bar'], $request->getConfig()->get('ssl_key')); - } - - public function testCanAddSslCert() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['cert' => '/foo.pem']); - $this->assertEquals('/foo.pem', $request->getConfig()->get('cert')); - } - - public function testCanAddSslCertPassword() - { - $request = (new MessageFactory())->createRequest('GET', '/', ['cert' => ['/foo.pem', 'bar']]); - $this->assertEquals(['/foo.pem', 'bar'], $request->getConfig()->get('cert')); - } - - public function testCreatesBodyWithoutZeroString() - { - $request = (new MessageFactory())->createRequest('PUT', 'http://test.com', ['body' => '0']); - $this->assertSame('0', (string) $request->getBody()); - } - - public function testCanSetProtocolVersion() - { - $request = (new MessageFactory())->createRequest('GET', 'http://t.com', ['version' => 1.0]); - $this->assertEquals(1.0, $request->getProtocolVersion()); - } - - public function testCanAddJsonData() - { - $request = (new MessageFactory())->createRequest('PUT', 'http://f.com', [ - 'json' => ['foo' => 'bar'] - ]); - $this->assertEquals( - 'application/json', - $request->getHeader('Content-Type') - ); - $this->assertEquals('{"foo":"bar"}', (string) $request->getBody()); - } - - public function testCanAddJsonDataToAPostRequest() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.com', [ - 'json' => ['foo' => 'bar'] - ]); - $this->assertEquals( - 'application/json', - $request->getHeader('Content-Type') - ); - $this->assertEquals('{"foo":"bar"}', (string) $request->getBody()); - } - - public function testCanAddJsonDataAndNotOverwriteContentType() - { - $request = (new MessageFactory())->createRequest('PUT', 'http://f.com', [ - 'headers' => ['Content-Type' => 'foo'], - 'json' => null - ]); - $this->assertEquals('foo', $request->getHeader('Content-Type')); - $this->assertEquals('null', (string) $request->getBody()); - } - - public function testCanUseCustomRequestOptions() - { - $c = false; - $f = new MessageFactory([ - 'foo' => function (RequestInterface $request, $value) use (&$c) { - $c = true; - $this->assertEquals('bar', $value); - } - ]); - - $f->createRequest('PUT', 'http://f.com', [ - 'headers' => ['Content-Type' => 'foo'], - 'foo' => 'bar' - ]); - - $this->assertTrue($c); - } - - /** - * @ticket https://github.com/guzzle/guzzle/issues/706 - */ - public function testDoesNotApplyPostBodyRightAway() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [ - 'body' => ['foo' => ['bar', 'baz']] - ]); - $this->assertEquals('', $request->getHeader('Content-Type')); - $this->assertEquals('', $request->getHeader('Content-Length')); - $request->getBody()->setAggregator(Query::duplicateAggregator()); - $request->getBody()->applyRequestHeaders($request); - $this->assertEquals('foo=bar&foo=baz', $request->getBody()); - } - - public function testCanForceMultipartUploadWithContentType() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([new Response(200)])); - $history = new History(); - $client->getEmitter()->attach($history); - $client->post('http://foo.com', [ - 'headers' => ['Content-Type' => 'multipart/form-data'], - 'body' => ['foo' => 'bar'] - ]); - $this->assertContains( - 'multipart/form-data; boundary=', - $history->getLastRequest()->getHeader('Content-Type') - ); - $this->assertContains( - "Content-Disposition: form-data; name=\"foo\"\r\n\r\nbar", - (string) $history->getLastRequest()->getBody() - ); - } - - public function testDecodeDoesNotForceAcceptHeader() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [ - 'decode_content' => true - ]); - $this->assertEquals('', $request->getHeader('Accept-Encoding')); - $this->assertTrue($request->getConfig()->get('decode_content')); - } - - public function testDecodeCanAddAcceptHeader() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [ - 'decode_content' => 'gzip' - ]); - $this->assertEquals('gzip', $request->getHeader('Accept-Encoding')); - $this->assertTrue($request->getConfig()->get('decode_content')); - } - - public function testCanDisableDecoding() - { - $request = (new MessageFactory())->createRequest('POST', 'http://f.cn', [ - 'decode_content' => false - ]); - $this->assertEquals('', $request->getHeader('Accept-Encoding')); - $this->assertNull($request->getConfig()->get('decode_content')); - } -} - -class ExtendedFactory extends MessageFactory -{ - protected function add_foo() {} -} diff --git a/vendor/guzzlehttp/guzzle/tests/Message/MessageParserTest.php b/vendor/guzzlehttp/guzzle/tests/Message/MessageParserTest.php deleted file mode 100644 index 0bcc9430..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Message/MessageParserTest.php +++ /dev/null @@ -1,276 +0,0 @@ -compareRequestResults($parts, $parser->parseRequest($message)); - } - - /** - * @dataProvider responseProvider - */ - public function testParsesResponses($message, $parts) - { - $parser = new MessageParser(); - $this->compareResponseResults($parts, $parser->parseResponse($message)); - } - - public function testParsesRequestsWithMissingProtocol() - { - $parser = new MessageParser(); - $parts = $parser->parseRequest("GET /\r\nHost: Foo.com\r\n\r\n"); - $this->assertEquals('GET', $parts['method']); - $this->assertEquals('HTTP', $parts['protocol']); - $this->assertEquals('1.1', $parts['protocol_version']); - } - - public function testParsesRequestsWithMissingVersion() - { - $parser = new MessageParser(); - $parts = $parser->parseRequest("GET / HTTP\r\nHost: Foo.com\r\n\r\n"); - $this->assertEquals('GET', $parts['method']); - $this->assertEquals('HTTP', $parts['protocol']); - $this->assertEquals('1.1', $parts['protocol_version']); - } - - public function testParsesResponsesWithMissingReasonPhrase() - { - $parser = new MessageParser(); - $parts = $parser->parseResponse("HTTP/1.1 200\r\n\r\n"); - $this->assertEquals('200', $parts['code']); - $this->assertEquals('', $parts['reason_phrase']); - $this->assertEquals('HTTP', $parts['protocol']); - $this->assertEquals('1.1', $parts['protocol_version']); - } - - public function requestProvider() - { - $auth = base64_encode('michael:foo'); - - return array( - - // Empty request - array('', false), - - // Converts casing of request. Does not require host header. - array("GET / HTTP/1.1\r\n\r\n", array( - 'method' => 'GET', - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'request_url' => array( - 'scheme' => 'http', - 'host' => '', - 'port' => '', - 'path' => '/', - 'query' => '' - ), - 'headers' => array(), - 'body' => '' - )), - // Path and query string, multiple header values per header and case sensitive storage - array("HEAD /path?query=foo HTTP/1.0\r\nHost: example.com\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\nX-Foo: Baz\r\n\r\n", array( - 'method' => 'HEAD', - 'protocol' => 'HTTP', - 'protocol_version' => '1.0', - 'request_url' => array( - 'scheme' => 'http', - 'host' => 'example.com', - 'port' => '', - 'path' => '/path', - 'query' => 'query=foo' - ), - 'headers' => array( - 'Host' => 'example.com', - 'X-Foo' => array('foo', 'foo', 'Baz'), - 'x-foo' => 'Bar' - ), - 'body' => '' - )), - // Includes a body - array("PUT / HTTP/1.0\r\nhost: example.com:443\r\nContent-Length: 4\r\n\r\ntest", array( - 'method' => 'PUT', - 'protocol' => 'HTTP', - 'protocol_version' => '1.0', - 'request_url' => array( - 'scheme' => 'https', - 'host' => 'example.com', - 'port' => '443', - 'path' => '/', - 'query' => '' - ), - 'headers' => array( - 'host' => 'example.com:443', - 'Content-Length' => '4' - ), - 'body' => 'test' - )), - // Includes Authorization headers - array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nAuthorization: Basic {$auth}\r\n\r\n", array( - 'method' => 'GET', - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'request_url' => array( - 'scheme' => 'http', - 'host' => 'example.com', - 'port' => '8080', - 'path' => '/', - 'query' => '' - ), - 'headers' => array( - 'Host' => 'example.com:8080', - 'Authorization' => "Basic {$auth}" - ), - 'body' => '' - )), - // Include authorization header - array("GET / HTTP/1.1\r\nHost: example.com:8080\r\nauthorization: Basic {$auth}\r\n\r\n", array( - 'method' => 'GET', - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'request_url' => array( - 'scheme' => 'http', - 'host' => 'example.com', - 'port' => '8080', - 'path' => '/', - 'query' => '' - ), - 'headers' => array( - 'Host' => 'example.com:8080', - 'authorization' => "Basic {$auth}" - ), - 'body' => '' - )), - ); - } - - public function responseProvider() - { - return array( - // Empty request - array('', false), - - array("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'code' => '200', - 'reason_phrase' => 'OK', - 'headers' => array( - 'Content-Length' => 0 - ), - 'body' => '' - )), - array("HTTP/1.0 400 Bad Request\r\nContent-Length: 0\r\n\r\n", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.0', - 'code' => '400', - 'reason_phrase' => 'Bad Request', - 'headers' => array( - 'Content-Length' => 0 - ), - 'body' => '' - )), - array("HTTP/1.0 100 Continue\r\n\r\n", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.0', - 'code' => '100', - 'reason_phrase' => 'Continue', - 'headers' => array(), - 'body' => '' - )), - array("HTTP/1.1 204 No Content\r\nX-Foo: foo\r\nx-foo: Bar\r\nX-Foo: foo\r\n\r\n", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'code' => '204', - 'reason_phrase' => 'No Content', - 'headers' => array( - 'X-Foo' => array('foo', 'foo'), - 'x-foo' => 'Bar' - ), - 'body' => '' - )), - array("HTTP/1.1 200 Ok that is great!\r\nContent-Length: 4\r\n\r\nTest", array( - 'protocol' => 'HTTP', - 'protocol_version' => '1.1', - 'code' => '200', - 'reason_phrase' => 'Ok that is great!', - 'headers' => array( - 'Content-Length' => 4 - ), - 'body' => 'Test' - )), - ); - } - - public function compareRequestResults($result, $expected) - { - if (!$result) { - $this->assertFalse($expected); - return; - } - - $this->assertEquals($result['method'], $expected['method']); - $this->assertEquals($result['protocol'], $expected['protocol']); - $this->assertEquals($result['protocol_version'], $expected['protocol_version']); - $this->assertEquals($result['request_url'], $expected['request_url']); - $this->assertEquals($result['body'], $expected['body']); - $this->compareHttpHeaders($result['headers'], $expected['headers']); - } - - public function compareResponseResults($result, $expected) - { - if (!$result) { - $this->assertFalse($expected); - return; - } - - $this->assertEquals($result['protocol'], $expected['protocol']); - $this->assertEquals($result['protocol_version'], $expected['protocol_version']); - $this->assertEquals($result['code'], $expected['code']); - $this->assertEquals($result['reason_phrase'], $expected['reason_phrase']); - $this->assertEquals($result['body'], $expected['body']); - $this->compareHttpHeaders($result['headers'], $expected['headers']); - } - - protected function normalizeHeaders($headers) - { - $normalized = array(); - foreach ($headers as $key => $value) { - $key = strtolower($key); - if (!isset($normalized[$key])) { - $normalized[$key] = $value; - } elseif (!is_array($normalized[$key])) { - $normalized[$key] = array($value); - } else { - $normalized[$key][] = $value; - } - } - - foreach ($normalized as $key => &$value) { - if (is_array($value)) { - sort($value); - } - } - - return $normalized; - } - - public function compareHttpHeaders($result, $expected) - { - // Aggregate all headers case-insensitively - $result = $this->normalizeHeaders($result); - $expected = $this->normalizeHeaders($expected); - $this->assertEquals($result, $expected); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Message/RequestTest.php b/vendor/guzzlehttp/guzzle/tests/Message/RequestTest.php deleted file mode 100644 index 4e670a49..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Message/RequestTest.php +++ /dev/null @@ -1,144 +0,0 @@ - '123'], Stream::factory('foo')); - $this->assertEquals('PUT', $r->getMethod()); - $this->assertEquals('/test', $r->getUrl()); - $this->assertEquals('123', $r->getHeader('test')); - $this->assertEquals('foo', $r->getBody()); - } - - public function testConstructorInitializesMessageWithMixedCaseHeaders() - { - $r = new Request('GET', '/test', [ - 'Set-Cookie' => 'foo=bar, baz=bam', - 'Set-cookie' => 'hi=there', - 'other' => ['1', '2'] - ]); - - $this->assertEquals('foo=bar, baz=bam, hi=there', $r->getHeader('Set-Cookie')); - $this->assertEquals('1, 2', $r->getHeader('other')); - } - - public function testConstructorInitializesMessageWithProtocolVersion() - { - $r = new Request('GET', '', [], null, ['protocol_version' => 10]); - $this->assertEquals(10, $r->getProtocolVersion()); - } - - public function testConstructorInitializesMessageWithEmitter() - { - $e = new Emitter(); - $r = new Request('GET', '', [], null, ['emitter' => $e]); - $this->assertSame($r->getEmitter(), $e); - } - - public function testCloneIsDeep() - { - $r = new Request('GET', '/test', ['foo' => 'baz'], Stream::factory('foo')); - $r2 = clone $r; - - $this->assertNotSame($r->getEmitter(), $r2->getEmitter()); - $this->assertEquals('foo', $r2->getBody()); - - $r->getConfig()->set('test', 123); - $this->assertFalse($r2->getConfig()->hasKey('test')); - - $r->setPath('/abc'); - $this->assertEquals('/test', $r2->getPath()); - } - - public function testCastsToString() - { - $r = new Request('GET', 'http://test.com/test', ['foo' => 'baz'], Stream::factory('body')); - $s = explode("\r\n", (string) $r); - $this->assertEquals("GET /test HTTP/1.1", $s[0]); - $this->assertContains('Host: test.com', $s); - $this->assertContains('foo: baz', $s); - $this->assertContains('', $s); - $this->assertContains('body', $s); - } - - public function testSettingUrlOverridesHostHeaders() - { - $r = new Request('GET', 'http://test.com/test'); - $r->setUrl('https://baz.com/bar'); - $this->assertEquals('baz.com', $r->getHost()); - $this->assertEquals('baz.com', $r->getHeader('Host')); - $this->assertEquals('/bar', $r->getPath()); - $this->assertEquals('https', $r->getScheme()); - } - - public function testQueryIsMutable() - { - $r = new Request('GET', 'http://www.foo.com?baz=bar'); - $this->assertEquals('baz=bar', $r->getQuery()); - $this->assertInstanceOf('GuzzleHttp\Query', $r->getQuery()); - $r->getQuery()->set('hi', 'there'); - $this->assertEquals('/?baz=bar&hi=there', $r->getResource()); - } - - public function testQueryCanChange() - { - $r = new Request('GET', 'http://www.foo.com?baz=bar'); - $r->setQuery(new Query(['foo' => 'bar'])); - $this->assertEquals('foo=bar', $r->getQuery()); - } - - public function testCanChangeMethod() - { - $r = new Request('GET', 'http://www.foo.com'); - $r->setMethod('put'); - $this->assertEquals('PUT', $r->getMethod()); - } - - public function testCanChangeSchemeWithPort() - { - $r = new Request('GET', 'http://www.foo.com:80'); - $r->setScheme('https'); - $this->assertEquals('https://www.foo.com', $r->getUrl()); - } - - public function testCanChangeScheme() - { - $r = new Request('GET', 'http://www.foo.com'); - $r->setScheme('https'); - $this->assertEquals('https://www.foo.com', $r->getUrl()); - } - - public function testCanChangeHost() - { - $r = new Request('GET', 'http://www.foo.com:222'); - $r->setHost('goo'); - $this->assertEquals('http://goo:222', $r->getUrl()); - $this->assertEquals('goo:222', $r->getHeader('host')); - $r->setHost('goo:80'); - $this->assertEquals('http://goo', $r->getUrl()); - $this->assertEquals('goo', $r->getHeader('host')); - } - - public function testCanChangePort() - { - $r = new Request('GET', 'http://www.foo.com:222'); - $this->assertSame(222, $r->getPort()); - $this->assertEquals('www.foo.com', $r->getHost()); - $this->assertEquals('www.foo.com:222', $r->getHeader('host')); - $r->setPort(80); - $this->assertSame(80, $r->getPort()); - $this->assertEquals('www.foo.com', $r->getHost()); - $this->assertEquals('www.foo.com', $r->getHeader('host')); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Message/ResponseTest.php b/vendor/guzzlehttp/guzzle/tests/Message/ResponseTest.php deleted file mode 100644 index bbae24a1..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Message/ResponseTest.php +++ /dev/null @@ -1,120 +0,0 @@ - 'hi!']); - $this->assertEquals(999, $response->getStatusCode()); - $this->assertEquals('hi!', $response->getReasonPhrase()); - } - - public function testConvertsToString() - { - $response = new Response(200); - $this->assertEquals("HTTP/1.1 200 OK\r\n\r\n", (string) $response); - // Add another header - $response = new Response(200, ['X-Test' => 'Guzzle']); - $this->assertEquals("HTTP/1.1 200 OK\r\nX-Test: Guzzle\r\n\r\n", (string) $response); - $response = new Response(200, ['Content-Length' => 4], Stream::factory('test')); - $this->assertEquals("HTTP/1.1 200 OK\r\nContent-Length: 4\r\n\r\ntest", (string) $response); - } - - public function testConvertsToStringAndSeeksToByteZero() - { - $response = new Response(200); - $s = Stream::factory('foo'); - $s->read(1); - $response->setBody($s); - $this->assertEquals("HTTP/1.1 200 OK\r\n\r\nfoo", (string) $response); - } - - public function testParsesJsonResponses() - { - $json = '{"foo": "bar"}'; - $response = new Response(200, [], Stream::factory($json)); - $this->assertEquals(['foo' => 'bar'], $response->json()); - $this->assertEquals(json_decode($json), $response->json(['object' => true])); - - $response = new Response(200); - $this->assertEquals(null, $response->json()); - } - - /** - * @expectedException \GuzzleHttp\Exception\ParseException - * @expectedExceptionMessage Unable to parse JSON data: JSON_ERROR_SYNTAX - Syntax error, malformed JSON - */ - public function testThrowsExceptionWhenFailsToParseJsonResponse() - { - $response = new Response(200, [], Stream::factory('{"foo": "')); - $response->json(); - } - - public function testParsesXmlResponses() - { - $response = new Response(200, [], Stream::factory('bar')); - $this->assertEquals('bar', (string) $response->xml()->foo); - // Always return a SimpleXMLElement from the xml method - $response = new Response(200); - $this->assertEmpty((string) $response->xml()->foo); - } - - /** - * @expectedException \GuzzleHttp\Exception\XmlParseException - * @expectedExceptionMessage Unable to parse response body into XML: String could not be parsed as XML - */ - public function testThrowsExceptionWhenFailsToParseXmlResponse() - { - $response = new Response(200, [], Stream::factory('xml(); - } catch (XmlParseException $e) { - $xmlParseError = $e->getError(); - $this->assertInstanceOf('\LibXMLError', $xmlParseError); - $this->assertContains("Couldn't find end of Start Tag abc line 1", $xmlParseError->message); - throw $e; - } - } - - public function testHasEffectiveUrl() - { - $r = new Response(200); - $this->assertNull($r->getEffectiveUrl()); - $r->setEffectiveUrl('http://www.test.com'); - $this->assertEquals('http://www.test.com', $r->getEffectiveUrl()); - } - - public function testPreventsComplexExternalEntities() - { - $xml = ']>&test;'; - $response = new Response(200, [], Stream::factory($xml)); - - $oldCwd = getcwd(); - chdir(__DIR__); - try { - $xml = $response->xml(); - chdir($oldCwd); - $this->markTestIncomplete('Did not throw the expected exception! XML resolved as: ' . $xml->asXML()); - } catch (\Exception $e) { - chdir($oldCwd); - } - } - - public function testStatusAndReasonAreMutable() - { - $response = new Response(200); - $response->setStatusCode(201); - $this->assertEquals(201, $response->getStatusCode()); - $response->setReasonPhrase('Foo'); - $this->assertEquals('Foo', $response->getReasonPhrase()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/MimetypesTest.php b/vendor/guzzlehttp/guzzle/tests/MimetypesTest.php deleted file mode 100644 index a18ec381..00000000 --- a/vendor/guzzlehttp/guzzle/tests/MimetypesTest.php +++ /dev/null @@ -1,31 +0,0 @@ -assertEquals('text/x-php', Mimetypes::getInstance()->fromExtension('php')); - } - - public function testGetsFromFilename() - { - $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(__FILE__)); - } - - public function testGetsFromCaseInsensitiveFilename() - { - $this->assertEquals('text/x-php', Mimetypes::getInstance()->fromFilename(strtoupper(__FILE__))); - } - - public function testReturnsNullWhenNoMatchFound() - { - $this->assertNull(Mimetypes::getInstance()->fromExtension('foobar')); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/PoolTest.php b/vendor/guzzlehttp/guzzle/tests/PoolTest.php deleted file mode 100644 index b5f02add..00000000 --- a/vendor/guzzlehttp/guzzle/tests/PoolTest.php +++ /dev/null @@ -1,319 +0,0 @@ - 10]); - $this->assertSame($c, $this->readAttribute($p, 'client')); - $this->assertEquals(10, $this->readAttribute($p, 'poolSize')); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEachElement() - { - $c = new Client(); - $requests = ['foo']; - $p = new Pool($c, new \ArrayIterator($requests)); - $p->wait(); - } - - public function testSendsAndRealizesFuture() - { - $c = $this->getClient(); - $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]); - $this->assertTrue($p->wait()); - $this->assertFalse($p->wait()); - $this->assertTrue($this->readAttribute($p, 'isRealized')); - $this->assertFalse($p->cancel()); - } - - public function testSendsManyRequestsInCappedPool() - { - $c = $this->getClient(); - $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]); - $this->assertTrue($p->wait()); - $this->assertFalse($p->wait()); - } - - public function testSendsRequestsThatHaveNotBeenRealized() - { - $c = $this->getClient(); - $p = new Pool($c, [$c->createRequest('GET', 'http://foo.com')]); - $this->assertTrue($p->wait()); - $this->assertFalse($p->wait()); - $this->assertFalse($p->cancel()); - } - - public function testCancelsInFlightRequests() - { - $c = $this->getClient(); - $h = new History(); - $c->getEmitter()->attach($h); - $p = new Pool($c, [ - $c->createRequest('GET', 'http://foo.com'), - $c->createRequest('GET', 'http://foo.com', [ - 'events' => [ - 'before' => [ - 'fn' => function () use (&$p) { - $this->assertTrue($p->cancel()); - }, - 'priority' => RequestEvents::EARLY - ] - ] - ]) - ]); - ob_start(); - $p->wait(); - $contents = ob_get_clean(); - $this->assertEquals(1, count($h)); - $this->assertEquals('Cancelling', $contents); - } - - private function getClient() - { - $deferred = new Deferred(); - $future = new FutureArray( - $deferred->promise(), - function() use ($deferred) { - $deferred->resolve(['status' => 200, 'headers' => []]); - }, function () { - echo 'Cancelling'; - } - ); - - return new Client(['handler' => new MockHandler($future)]); - } - - public function testBatchesRequests() - { - $client = new Client(['handler' => function () { - throw new \RuntimeException('No network access'); - }]); - - $responses = [ - new Response(301, ['Location' => 'http://foo.com/bar']), - new Response(200), - new Response(200), - new Response(404) - ]; - - $client->getEmitter()->attach(new Mock($responses)); - $requests = [ - $client->createRequest('GET', 'http://foo.com/baz'), - $client->createRequest('HEAD', 'http://httpbin.org/get'), - $client->createRequest('PUT', 'http://httpbin.org/put'), - ]; - - $a = $b = $c = $d = 0; - $result = Pool::batch($client, $requests, [ - 'before' => function (BeforeEvent $e) use (&$a) { $a++; }, - 'complete' => function (CompleteEvent $e) use (&$b) { $b++; }, - 'error' => function (ErrorEvent $e) use (&$c) { $c++; }, - 'end' => function (EndEvent $e) use (&$d) { $d++; } - ]); - - $this->assertEquals(4, $a); - $this->assertEquals(2, $b); - $this->assertEquals(1, $c); - $this->assertEquals(3, $d); - $this->assertCount(3, $result); - $this->assertInstanceOf('GuzzleHttp\BatchResults', $result); - - // The first result is actually the second (redirect) response. - $this->assertSame($responses[1], $result[0]); - // The second result is a 1:1 request:response map - $this->assertSame($responses[2], $result[1]); - // The third entry is the 404 RequestException - $this->assertSame($responses[3], $result[2]->getResponse()); - } - - public function testBatchesRequestsWithDynamicPoolSize() - { - $client = new Client(['handler' => function () { - throw new \RuntimeException('No network access'); - }]); - - $responses = [ - new Response(301, ['Location' => 'http://foo.com/bar']), - new Response(200), - new Response(200), - new Response(404) - ]; - - $client->getEmitter()->attach(new Mock($responses)); - $requests = [ - $client->createRequest('GET', 'http://foo.com/baz'), - $client->createRequest('HEAD', 'http://httpbin.org/get'), - $client->createRequest('PUT', 'http://httpbin.org/put'), - ]; - - $a = $b = $c = $d = 0; - $result = Pool::batch($client, $requests, [ - 'before' => function (BeforeEvent $e) use (&$a) { $a++; }, - 'complete' => function (CompleteEvent $e) use (&$b) { $b++; }, - 'error' => function (ErrorEvent $e) use (&$c) { $c++; }, - 'end' => function (EndEvent $e) use (&$d) { $d++; }, - 'pool_size' => function ($queueSize) { - static $options = [1, 2, 1]; - static $queued = 0; - - $this->assertEquals( - $queued, - $queueSize, - 'The number of queued requests should be equal to the sum of pool sizes so far.' - ); - - $next = array_shift($options); - $queued += $next; - - return $next; - } - ]); - - $this->assertEquals(4, $a); - $this->assertEquals(2, $b); - $this->assertEquals(1, $c); - $this->assertEquals(3, $d); - $this->assertCount(3, $result); - $this->assertInstanceOf('GuzzleHttp\BatchResults', $result); - - // The first result is actually the second (redirect) response. - $this->assertSame($responses[1], $result[0]); - // The second result is a 1:1 request:response map - $this->assertSame($responses[2], $result[1]); - // The third entry is the 404 RequestException - $this->assertSame($responses[3], $result[2]->getResponse()); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Each event listener must be a callable or - */ - public function testBatchValidatesTheEventFormat() - { - $client = new Client(); - $requests = [$client->createRequest('GET', 'http://foo.com/baz')]; - Pool::batch($client, $requests, ['complete' => 'foo']); - } - - public function testEmitsProgress() - { - $client = new Client(['handler' => function () { - throw new \RuntimeException('No network access'); - }]); - - $responses = [new Response(200), new Response(404)]; - $client->getEmitter()->attach(new Mock($responses)); - $requests = [ - $client->createRequest('GET', 'http://foo.com/baz'), - $client->createRequest('HEAD', 'http://httpbin.org/get') - ]; - - $pool = new Pool($client, $requests); - $count = 0; - $thenned = null; - $pool->then( - function ($value) use (&$thenned) { - $thenned = $value; - }, - null, - function ($result) use (&$count, $requests) { - $this->assertSame($requests[$count], $result['request']); - if ($count == 0) { - $this->assertNull($result['error']); - $this->assertEquals(200, $result['response']->getStatusCode()); - } else { - $this->assertInstanceOf( - 'GuzzleHttp\Exception\ClientException', - $result['error'] - ); - } - $count++; - } - ); - - $pool->wait(); - $this->assertEquals(2, $count); - $this->assertEquals(true, $thenned); - } - - public function testDoesNotThrowInErrorEvent() - { - $client = new Client(); - $responses = [new Response(404)]; - $client->getEmitter()->attach(new Mock($responses)); - $requests = [$client->createRequest('GET', 'http://foo.com/baz')]; - $result = Pool::batch($client, $requests); - $this->assertCount(1, $result); - $this->assertInstanceOf('GuzzleHttp\Exception\ClientException', $result[0]); - } - - public function testHasSendMethod() - { - $client = new Client(); - $responses = [new Response(404)]; - $history = new History(); - $client->getEmitter()->attach($history); - $client->getEmitter()->attach(new Mock($responses)); - $requests = [$client->createRequest('GET', 'http://foo.com/baz')]; - Pool::send($client, $requests); - $this->assertCount(1, $history); - } - - public function testDoesNotInfinitelyRecurse() - { - $client = new Client(['handler' => function () { - throw new \RuntimeException('No network access'); - }]); - - $last = null; - $client->getEmitter()->on( - 'before', - function (BeforeEvent $e) use (&$last) { - $e->intercept(new Response(200)); - if (function_exists('xdebug_get_stack_depth')) { - if ($last) { - $this->assertEquals($last, xdebug_get_stack_depth()); - } else { - $last = xdebug_get_stack_depth(); - } - } - } - ); - - $requests = []; - for ($i = 0; $i < 100; $i++) { - $requests[] = $client->createRequest('GET', 'http://foo.com'); - } - - $pool = new Pool($client, $requests); - $pool->wait(); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php b/vendor/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php deleted file mode 100644 index 4b3b3916..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Post/MultipartBodyTest.php +++ /dev/null @@ -1,120 +0,0 @@ - 'bar'], [ - new PostFile('foo', 'abc', 'foo.txt') - ], 'abcdef'); - } - - public function testConstructorAddsFieldsAndFiles() - { - $b = $this->getTestBody(); - $this->assertEquals('abcdef', $b->getBoundary()); - $c = (string) $b; - $this->assertContains("--abcdef\r\nContent-Disposition: form-data; name=\"foo\"\r\n\r\nbar\r\n", $c); - $this->assertContains("--abcdef\r\nContent-Disposition: form-data; name=\"foo\"; filename=\"foo.txt\"\r\n" - . "Content-Type: text/plain\r\n\r\nabc\r\n--abcdef--", $c); - } - - public function testDoesNotModifyFieldFormat() - { - $m = new MultipartBody(['foo+baz' => 'bar+bam %20 boo'], [ - new PostFile('foo+bar', 'abc %20 123', 'foo.txt') - ], 'abcdef'); - $this->assertContains('name="foo+baz"', (string) $m); - $this->assertContains('name="foo+bar"', (string) $m); - $this->assertContains('bar+bam %20 boo', (string) $m); - $this->assertContains('abc %20 123', (string) $m); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testConstructorValidatesFiles() - { - new MultipartBody([], ['bar']); - } - - public function testConstructorCanCreateBoundary() - { - $b = new MultipartBody(); - $this->assertNotNull($b->getBoundary()); - } - - public function testWrapsStreamMethods() - { - $b = $this->getTestBody(); - $this->assertFalse($b->write('foo')); - $this->assertFalse($b->isWritable()); - $this->assertTrue($b->isReadable()); - $this->assertTrue($b->isSeekable()); - $this->assertEquals(0, $b->tell()); - } - - public function testCanDetachFieldsAndFiles() - { - $b = $this->getTestBody(); - $b->detach(); - $b->close(); - $this->assertEquals('', (string) $b); - } - - public function testIsSeekableReturnsTrueIfAllAreSeekable() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['isSeekable', 'isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('isSeekable') - ->will($this->returnValue(false)); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $p = new PostFile('foo', $s, 'foo.php'); - $b = new MultipartBody([], [$p]); - $this->assertFalse($b->isSeekable()); - $this->assertFalse($b->seek(10)); - } - - public function testReadsFromBuffer() - { - $b = $this->getTestBody(); - $c = $b->read(1); - $c .= $b->read(1); - $c .= $b->read(1); - $c .= $b->read(1); - $c .= $b->read(1); - $this->assertEquals('--abc', $c); - } - - public function testCalculatesSize() - { - $b = $this->getTestBody(); - $this->assertEquals(strlen($b), $b->getSize()); - } - - public function testCalculatesSizeAndReturnsNullForUnknown() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['getSize', 'isReadable']) - ->getMockForAbstractClass(); - $s->expects($this->once()) - ->method('getSize') - ->will($this->returnValue(null)); - $s->expects($this->once()) - ->method('isReadable') - ->will($this->returnValue(true)); - $b = new MultipartBody([], [new PostFile('foo', $s, 'foo.php')]); - $this->assertNull($b->getSize()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Post/PostBodyTest.php b/vendor/guzzlehttp/guzzle/tests/Post/PostBodyTest.php deleted file mode 100644 index 0283a5eb..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Post/PostBodyTest.php +++ /dev/null @@ -1,255 +0,0 @@ -assertTrue($b->isSeekable()); - $this->assertTrue($b->isReadable()); - $this->assertFalse($b->isWritable()); - $this->assertFalse($b->write('foo')); - } - - public function testApplyingWithNothingDoesNothing() - { - $b = new PostBody(); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertFalse($m->hasHeader('Content-Length')); - $this->assertFalse($m->hasHeader('Content-Type')); - } - - public function testCanForceMultipartUploadsWhenApplying() - { - $b = new PostBody(); - $b->forceMultipartUpload(true); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - } - - public function testApplyingWithFilesAddsMultipartUpload() - { - $b = new PostBody(); - $p = new PostFile('foo', fopen(__FILE__, 'r')); - $b->addFile($p); - $this->assertEquals([$p], $b->getFiles()); - $this->assertNull($b->getFile('missing')); - $this->assertSame($p, $b->getFile('foo')); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - } - - public function testApplyingWithFieldsAddsMultipartUpload() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $this->assertEquals(['foo' => 'bar'], $b->getFields()); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'application/x-www-form', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - } - - public function testMultipartWithNestedFields() - { - $b = new PostBody(); - $b->setField('foo', ['bar' => 'baz']); - $b->forceMultipartUpload(true); - $this->assertEquals(['foo' => ['bar' => 'baz']], $b->getFields()); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - $contents = $b->getContents(); - $this->assertContains('name="foo[bar]"', $contents); - $this->assertNotContains('name="foo"', $contents); - } - - public function testCountProvidesFieldsAndFiles() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->addFile(new PostFile('foo', fopen(__FILE__, 'r'))); - $this->assertEquals(2, count($b)); - $b->clearFiles(); - $b->removeField('foo'); - $this->assertEquals(0, count($b)); - $this->assertEquals([], $b->getFiles()); - $this->assertEquals([], $b->getFields()); - } - - public function testHasFields() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->setField('baz', '123'); - $this->assertEquals('bar', $b->getField('foo')); - $this->assertEquals('123', $b->getField('baz')); - $this->assertNull($b->getField('ahh')); - $this->assertTrue($b->hasField('foo')); - $this->assertFalse($b->hasField('test')); - $b->replaceFields(['abc' => '123']); - $this->assertFalse($b->hasField('foo')); - $this->assertTrue($b->hasField('abc')); - } - - public function testConvertsFieldsToQueryStyleBody() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->setField('baz', '123'); - $this->assertEquals('foo=bar&baz=123', $b); - $this->assertEquals(15, $b->getSize()); - $b->seek(0); - $this->assertEquals('foo=bar&baz=123', $b->getContents()); - $b->seek(0); - $this->assertEquals('foo=bar&baz=123', $b->read(1000)); - $this->assertEquals(15, $b->tell()); - } - - public function testCanSpecifyQueryAggregator() - { - $b = new PostBody(); - $b->setField('foo', ['baz', 'bar']); - $this->assertEquals('foo%5B0%5D=baz&foo%5B1%5D=bar', (string) $b); - $b = new PostBody(); - $b->setField('foo', ['baz', 'bar']); - $agg = Query::duplicateAggregator(); - $b->setAggregator($agg); - $this->assertEquals('foo=baz&foo=bar', (string) $b); - } - - public function testDetachesAndCloses() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->detach(); - $b->close(); - $this->assertEquals('', $b->read(10)); - } - - public function testDetachesWhenBodyIsPresent() - { - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->getContents(); - $b->detach(); - } - - public function testFlushAndMetadataPlaceholders() - { - $b = new PostBody(); - $this->assertEquals([], $b->getMetadata()); - $this->assertNull($b->getMetadata('foo')); - } - - public function testCreatesMultipartUploadWithMultiFields() - { - $b = new PostBody(); - $b->setField('testing', ['baz', 'bar']); - $b->setField('other', 'hi'); - $b->setField('third', 'there'); - $b->addFile(new PostFile('foo', fopen(__FILE__, 'r'))); - $s = (string) $b; - $this->assertContains(file_get_contents(__FILE__), $s); - $this->assertContains('testing=bar', $s); - $this->assertContains( - 'Content-Disposition: form-data; name="third"', - $s - ); - $this->assertContains( - 'Content-Disposition: form-data; name="other"', - $s - ); - } - - public function testMultipartWithBase64Fields() - { - $b = new PostBody(); - $b->setField('foo64', '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc='); - $b->forceMultipartUpload(true); - $this->assertEquals( - ['foo64' => '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc='], - $b->getFields() - ); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - $contents = $b->getContents(); - $this->assertContains('name="foo64"', $contents); - $this->assertContains( - '/xA2JhWEqPcgyLRDdir9WSRi/khpb2Lh3ooqv+5VYoc=', - $contents - ); - } - - public function testMultipartWithAmpersandInValue() - { - $b = new PostBody(); - $b->setField('a', 'b&c=d'); - $b->forceMultipartUpload(true); - $this->assertEquals(['a' => 'b&c=d'], $b->getFields()); - $m = new Request('POST', '/'); - $b->applyRequestHeaders($m); - $this->assertContains( - 'multipart/form-data', - $m->getHeader('Content-Type') - ); - $this->assertTrue($m->hasHeader('Content-Length')); - $contents = $b->getContents(); - $this->assertContains('name="a"', $contents); - $this->assertContains('b&c=d', $contents); - } - - /** - * @expectedException \GuzzleHttp\Stream\Exception\CannotAttachException - */ - public function testCannotAttach() - { - $b = new PostBody(); - $b->attach('foo'); - } - - public function testDoesNotOverwriteExistingHeaderForUrlencoded() - { - $m = new Request('POST', 'http://foo.com', [ - 'content-type' => 'application/x-www-form-urlencoded; charset=utf-8' - ]); - $b = new PostBody(); - $b->setField('foo', 'bar'); - $b->applyRequestHeaders($m); - $this->assertEquals( - 'application/x-www-form-urlencoded; charset=utf-8', - $m->getHeader('Content-Type') - ); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Post/PostFileTest.php b/vendor/guzzlehttp/guzzle/tests/Post/PostFileTest.php deleted file mode 100644 index 800cee50..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Post/PostFileTest.php +++ /dev/null @@ -1,61 +0,0 @@ -assertInstanceOf('GuzzleHttp\Post\PostFileInterface', $p); - $this->assertEquals('hi', $p->getContent()); - $this->assertEquals('foo', $p->getName()); - $this->assertEquals('/path/to/test.php', $p->getFilename()); - $this->assertEquals( - 'form-data; name="foo"; filename="test.php"', - $p->getHeaders()['Content-Disposition'] - ); - } - - public function testGetsFilenameFromMetadata() - { - $p = new PostFile('foo', fopen(__FILE__, 'r')); - $this->assertEquals(__FILE__, $p->getFilename()); - } - - public function testDefaultsToNameWhenNoFilenameExists() - { - $p = new PostFile('foo', 'bar'); - $this->assertEquals('foo', $p->getFilename()); - } - - public function testCreatesFromMultipartFormData() - { - $mp = new MultipartBody([], [], 'baz'); - $p = new PostFile('foo', $mp); - $this->assertEquals( - 'form-data; name="foo"', - $p->getHeaders()['Content-Disposition'] - ); - $this->assertEquals( - 'multipart/form-data; boundary=baz', - $p->getHeaders()['Content-Type'] - ); - } - - public function testCanAddHeaders() - { - $p = new PostFile('foo', Stream::factory('hi'), 'test.php', [ - 'X-Foo' => '123', - 'Content-Disposition' => 'bar' - ]); - $this->assertEquals('bar', $p->getHeaders()['Content-Disposition']); - $this->assertEquals('123', $p->getHeaders()['X-Foo']); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/QueryParserTest.php b/vendor/guzzlehttp/guzzle/tests/QueryParserTest.php deleted file mode 100644 index e9075a80..00000000 --- a/vendor/guzzlehttp/guzzle/tests/QueryParserTest.php +++ /dev/null @@ -1,80 +0,0 @@ - ['a', 'b']]], - // Can parse multi-valued items that use numeric indices - ['q[0]=a&q[1]=b', ['q' => ['a', 'b']]], - // Can parse duplicates and does not include numeric indices - ['q[]=a&q[]=b', ['q' => ['a', 'b']]], - // Ensures that the value of "q" is an array even though one value - ['q[]=a', ['q' => ['a']]], - // Does not modify "." to "_" like PHP's parse_str() - ['q.a=a&q.b=b', ['q.a' => 'a', 'q.b' => 'b']], - // Can decode %20 to " " - ['q%20a=a%20b', ['q a' => 'a b']], - // Can parse funky strings with no values by assigning each to null - ['q&a', ['q' => null, 'a' => null]], - // Does not strip trailing equal signs - ['data=abc=', ['data' => 'abc=']], - // Can store duplicates without affecting other values - ['foo=a&foo=b&?µ=c', ['foo' => ['a', 'b'], '?µ' => 'c']], - // Sets value to null when no "=" is present - ['foo', ['foo' => null]], - // Preserves "0" keys. - ['0', ['0' => null]], - // Sets the value to an empty string when "=" is present - ['0=', ['0' => '']], - // Preserves falsey keys - ['var=0', ['var' => '0']], - // Can deeply nest and store duplicate PHP values - ['a[b][c]=1&a[b][c]=2', [ - 'a' => ['b' => ['c' => ['1', '2']]] - ]], - // Can parse PHP style arrays - ['a[b]=c&a[d]=e', ['a' => ['b' => 'c', 'd' => 'e']]], - // Ensure it doesn't leave things behind with repeated values - // Can parse mult-values items - ['q=a&q=b&q=c', ['q' => ['a', 'b', 'c']]], - ]; - } - - /** - * @dataProvider parseQueryProvider - */ - public function testParsesQueries($input, $output) - { - $query = Query::fromString($input); - $this->assertEquals($output, $query->toArray()); - // Normalize the input and output - $query->setEncodingType(false); - $this->assertEquals(rawurldecode($input), (string) $query); - } - - public function testConvertsPlusSymbolsToSpacesByDefault() - { - $query = Query::fromString('var=foo+bar', true); - $this->assertEquals('foo bar', $query->get('var')); - } - - public function testCanControlDecodingType() - { - $qp = new QueryParser(); - $q = new Query(); - $qp->parseInto($q, 'var=foo+bar', Query::RFC3986); - $this->assertEquals('foo+bar', $q->get('var')); - $qp->parseInto($q, 'var=foo+bar', Query::RFC1738); - $this->assertEquals('foo bar', $q->get('var')); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/QueryTest.php b/vendor/guzzlehttp/guzzle/tests/QueryTest.php deleted file mode 100644 index 8b9d3448..00000000 --- a/vendor/guzzlehttp/guzzle/tests/QueryTest.php +++ /dev/null @@ -1,171 +0,0 @@ - 'baz', 'bar' => 'bam boozle']); - $this->assertEquals('foo=baz&bar=bam%20boozle', (string) $q); - } - - public function testCanDisableUrlEncoding() - { - $q = new Query(['bar' => 'bam boozle']); - $q->setEncodingType(false); - $this->assertEquals('bar=bam boozle', (string) $q); - } - - public function testCanSpecifyRfc1783UrlEncodingType() - { - $q = new Query(['bar abc' => 'bam boozle']); - $q->setEncodingType(Query::RFC1738); - $this->assertEquals('bar+abc=bam+boozle', (string) $q); - } - - public function testCanSpecifyRfc3986UrlEncodingType() - { - $q = new Query(['bar abc' => 'bam boozle', 'ሴ' => 'hi']); - $q->setEncodingType(Query::RFC3986); - $this->assertEquals('bar%20abc=bam%20boozle&%E1%88%B4=hi', (string) $q); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesEncodingType() - { - (new Query(['bar' => 'bam boozle']))->setEncodingType('foo'); - } - - public function testAggregatesMultipleValues() - { - $q = new Query(['foo' => ['bar', 'baz']]); - $this->assertEquals('foo%5B0%5D=bar&foo%5B1%5D=baz', (string) $q); - } - - public function testCanSetAggregator() - { - $q = new Query(['foo' => ['bar', 'baz']]); - $q->setAggregator(function (array $data) { - return ['foo' => ['barANDbaz']]; - }); - $this->assertEquals('foo=barANDbaz', (string) $q); - } - - public function testAllowsMultipleValuesPerKey() - { - $q = new Query(); - $q->add('facet', 'size'); - $q->add('facet', 'width'); - $q->add('facet.field', 'foo'); - // Use the duplicate aggregator - $q->setAggregator($q::duplicateAggregator()); - $this->assertEquals('facet=size&facet=width&facet.field=foo', (string) $q); - } - - public function testAllowsZeroValues() - { - $query = new Query(array( - 'foo' => 0, - 'baz' => '0', - 'bar' => null, - 'boo' => false - )); - $this->assertEquals('foo=0&baz=0&bar&boo=', (string) $query); - } - - private $encodeData = [ - 't' => [ - 'v1' => ['a', '1'], - 'v2' => 'b', - 'v3' => ['v4' => 'c', 'v5' => 'd'] - ] - ]; - - public function testEncodesDuplicateAggregator() - { - $agg = Query::duplicateAggregator(); - $result = $agg($this->encodeData); - $this->assertEquals(array( - 't[v1]' => ['a', '1'], - 't[v2]' => ['b'], - 't[v3][v4]' => ['c'], - 't[v3][v5]' => ['d'], - ), $result); - } - - public function testDuplicateEncodesNoNumericIndices() - { - $agg = Query::duplicateAggregator(); - $result = $agg($this->encodeData); - $this->assertEquals(array( - 't[v1]' => ['a', '1'], - 't[v2]' => ['b'], - 't[v3][v4]' => ['c'], - 't[v3][v5]' => ['d'], - ), $result); - } - - public function testEncodesPhpAggregator() - { - $agg = Query::phpAggregator(); - $result = $agg($this->encodeData); - $this->assertEquals(array( - 't[v1][0]' => ['a'], - 't[v1][1]' => ['1'], - 't[v2]' => ['b'], - 't[v3][v4]' => ['c'], - 't[v3][v5]' => ['d'], - ), $result); - } - - public function testPhpEncodesNoNumericIndices() - { - $agg = Query::phpAggregator(false); - $result = $agg($this->encodeData); - $this->assertEquals(array( - 't[v1][]' => ['a', '1'], - 't[v2]' => ['b'], - 't[v3][v4]' => ['c'], - 't[v3][v5]' => ['d'], - ), $result); - } - - public function testCanDisableUrlEncodingDecoding() - { - $q = Query::fromString('foo=bar+baz boo%20', false); - $this->assertEquals('bar+baz boo%20', $q['foo']); - $this->assertEquals('foo=bar+baz boo%20', (string) $q); - } - - public function testCanChangeUrlEncodingDecodingToRfc1738() - { - $q = Query::fromString('foo=bar+baz', Query::RFC1738); - $this->assertEquals('bar baz', $q['foo']); - $this->assertEquals('foo=bar+baz', (string) $q); - } - - public function testCanChangeUrlEncodingDecodingToRfc3986() - { - $q = Query::fromString('foo=bar%20baz', Query::RFC3986); - $this->assertEquals('bar baz', $q['foo']); - $this->assertEquals('foo=bar%20baz', (string) $q); - } - - public function testQueryStringsAllowSlashButDoesNotDecodeWhenDisable() - { - $q = Query::fromString('foo=bar%2Fbaz&bam=boo%20boo', Query::RFC3986); - $q->setEncodingType(false); - $this->assertEquals('foo=bar/baz&bam=boo boo', (string) $q); - } - - public function testQueryStringsAllowDecodingEncodingCompletelyDisabled() - { - $q = Query::fromString('foo=bar%2Fbaz&bam=boo boo!', false); - $this->assertEquals('foo=bar%2Fbaz&bam=boo boo!', (string) $q); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/RequestFsmTest.php b/vendor/guzzlehttp/guzzle/tests/RequestFsmTest.php deleted file mode 100644 index dd676840..00000000 --- a/vendor/guzzlehttp/guzzle/tests/RequestFsmTest.php +++ /dev/null @@ -1,187 +0,0 @@ -mf = new MessageFactory(); - } - - public function testEmitsBeforeEventInTransition() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 200]); - }, $this->mf); - $t = new Transaction(new Client(), new Request('GET', 'http://foo.com')); - $c = false; - $t->request->getEmitter()->on('before', function (BeforeEvent $e) use (&$c) { - $c = true; - }); - $fsm($t); - $this->assertTrue($c); - } - - public function testEmitsCompleteEventInTransition() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 200]); - }, $this->mf); - $t = new Transaction(new Client(), new Request('GET', 'http://foo.com')); - $t->response = new Response(200); - $t->state = 'complete'; - $c = false; - $t->request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$c) { - $c = true; - }); - $fsm($t); - $this->assertTrue($c); - } - - public function testDoesNotEmitCompleteForFuture() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 200]); - }, $this->mf); - $t = new Transaction(new Client(), new Request('GET', 'http://foo.com')); - $deferred = new Deferred(); - $t->response = new FutureResponse($deferred->promise()); - $t->state = 'complete'; - $c = false; - $t->request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$c) { - $c = true; - }); - $fsm($t); - $this->assertFalse($c); - } - - public function testTransitionsThroughSuccessfulTransfer() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([new Response(200)])); - $request = $client->createRequest('GET', 'http://ewfewwef.com'); - $this->addListeners($request, $calls); - $client->send($request); - $this->assertEquals(['before', 'complete', 'end'], $calls); - } - - public function testTransitionsThroughErrorsInBefore() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 200]); - }, $this->mf); - $client = new Client(); - $request = $client->createRequest('GET', 'http://ewfewwef.com'); - $t = new Transaction($client, $request); - $calls = []; - $this->addListeners($t->request, $calls); - $t->request->getEmitter()->on('before', function (BeforeEvent $e) { - throw new \Exception('foo'); - }); - try { - $fsm($t); - $this->fail('did not throw'); - } catch (RequestException $e) { - $this->assertContains('foo', $t->exception->getMessage()); - $this->assertEquals(['before', 'error', 'end'], $calls); - } - } - - public function testTransitionsThroughErrorsInComplete() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([new Response(200)])); - $request = $client->createRequest('GET', 'http://ewfewwef.com'); - $this->addListeners($request, $calls); - $request->getEmitter()->once('complete', function (CompleteEvent $e) { - throw new \Exception('foo'); - }); - try { - $client->send($request); - $this->fail('did not throw'); - } catch (RequestException $e) { - $this->assertContains('foo', $e->getMessage()); - $this->assertEquals(['before', 'complete', 'error', 'end'], $calls); - } - } - - public function testTransitionsThroughErrorInterception() - { - $fsm = new RequestFsm(function () { - return new CompletedFutureArray(['status' => 404]); - }, $this->mf); - $client = new Client(); - $request = $client->createRequest('GET', 'http://ewfewwef.com'); - $t = new Transaction($client, $request); - $calls = []; - $this->addListeners($t->request, $calls); - $t->request->getEmitter()->on('error', function (ErrorEvent $e) { - $e->intercept(new Response(200)); - }); - $fsm($t); - $this->assertEquals(200, $t->response->getStatusCode()); - $this->assertNull($t->exception); - $this->assertEquals(['before', 'complete', 'error', 'complete', 'end'], $calls); - } - - private function addListeners(RequestInterface $request, &$calls) - { - $request->getEmitter()->on('before', function (BeforeEvent $e) use (&$calls) { - $calls[] = 'before'; - }, RequestEvents::EARLY); - $request->getEmitter()->on('complete', function (CompleteEvent $e) use (&$calls) { - $calls[] = 'complete'; - }, RequestEvents::EARLY); - $request->getEmitter()->on('error', function (ErrorEvent $e) use (&$calls) { - $calls[] = 'error'; - }, RequestEvents::EARLY); - $request->getEmitter()->on('end', function (EndEvent $e) use (&$calls) { - $calls[] = 'end'; - }, RequestEvents::EARLY); - } - - /** - * @expectedException \GuzzleHttp\Exception\RequestException - * @expectedExceptionMessage Too many state transitions - */ - public function testDetectsInfiniteLoops() - { - $client = new Client([ - 'fsm' => $fsm = new RequestFsm( - function () { - return new CompletedFutureArray(['status' => 200]); - }, - new MessageFactory(), - 3 - ) - ]); - $request = $client->createRequest('GET', 'http://foo.com:123'); - $request->getEmitter()->on('before', function () { - throw new \Exception('foo'); - }); - $request->getEmitter()->on('error', function ($e) { - $e->retry(); - }); - $client->send($request); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/RingBridgeTest.php b/vendor/guzzlehttp/guzzle/tests/RingBridgeTest.php deleted file mode 100644 index dc26a42a..00000000 --- a/vendor/guzzlehttp/guzzle/tests/RingBridgeTest.php +++ /dev/null @@ -1,195 +0,0 @@ - 'hello' - ], $stream); - $request->getConfig()->set('foo', 'bar'); - $trans = new Transaction(new Client(), $request); - $factory = new MessageFactory(); - $fsm = new RequestFsm(function () {}, new MessageFactory()); - $r = RingBridge::prepareRingRequest($trans, $factory, $fsm); - $this->assertEquals('http', $r['scheme']); - $this->assertEquals('1.1', $r['version']); - $this->assertEquals('GET', $r['http_method']); - $this->assertEquals('http://httpbin.org/get?a=b', $r['url']); - $this->assertEquals('/get', $r['uri']); - $this->assertEquals('a=b', $r['query_string']); - $this->assertEquals([ - 'Host' => ['httpbin.org'], - 'test' => ['hello'] - ], $r['headers']); - $this->assertSame($stream, $r['body']); - $this->assertEquals(['foo' => 'bar'], $r['client']); - $this->assertFalse($r['future']); - } - - public function testCreatesRingRequestsWithNullQueryString() - { - $request = new Request('GET', 'http://httpbin.org'); - $trans = new Transaction(new Client(), $request); - $factory = new MessageFactory(); - $fsm = new RequestFsm(function () {}, new MessageFactory()); - $r = RingBridge::prepareRingRequest($trans, $factory, $fsm); - $this->assertNull($r['query_string']); - $this->assertEquals('/', $r['uri']); - $this->assertEquals(['Host' => ['httpbin.org']], $r['headers']); - $this->assertNull($r['body']); - $this->assertEquals([], $r['client']); - } - - public function testAddsProgress() - { - Server::enqueue([new Response(200)]); - $client = new Client(['base_url' => Server::$url]); - $request = $client->createRequest('GET'); - $called = false; - $request->getEmitter()->on( - 'progress', - function (ProgressEvent $e) use (&$called) { - $called = true; - } - ); - $this->assertEquals(200, $client->send($request)->getStatusCode()); - $this->assertTrue($called); - } - - public function testGetsResponseProtocolVersionAndEffectiveUrlAndReason() - { - $client = new Client([ - 'handler' => new MockHandler([ - 'status' => 200, - 'reason' => 'test', - 'headers' => [], - 'version' => '1.0', - 'effective_url' => 'http://foo.com' - ]) - ]); - $request = $client->createRequest('GET', 'http://foo.com'); - $response = $client->send($request); - $this->assertEquals('1.0', $response->getProtocolVersion()); - $this->assertEquals('http://foo.com', $response->getEffectiveUrl()); - $this->assertEquals('test', $response->getReasonPhrase()); - } - - public function testGetsStreamFromResponse() - { - $res = fopen('php://temp', 'r+'); - fwrite($res, 'foo'); - rewind($res); - $client = new Client([ - 'handler' => new MockHandler([ - 'status' => 200, - 'headers' => [], - 'body' => $res - ]) - ]); - $request = $client->createRequest('GET', 'http://foo.com'); - $response = $client->send($request); - $this->assertEquals('foo', (string) $response->getBody()); - } - - public function testEmitsErrorEventOnError() - { - $client = new Client(['base_url' => 'http://127.0.0.1:123']); - $request = $client->createRequest('GET'); - $called = false; - $request->getEmitter()->on('error', function () use (&$called) { - $called = true; - }); - $request->getConfig()['timeout'] = 0.001; - $request->getConfig()['connect_timeout'] = 0.001; - try { - $client->send($request); - $this->fail('did not throw'); - } catch (RequestException $e) { - $this->assertSame($request, $e->getRequest()); - $this->assertContains('cURL error', $e->getMessage()); - $this->assertTrue($called); - } - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesRingRequest() - { - RingBridge::fromRingRequest([]); - } - - public function testCreatesRequestFromRing() - { - $request = RingBridge::fromRingRequest([ - 'http_method' => 'GET', - 'uri' => '/', - 'headers' => [ - 'foo' => ['bar'], - 'host' => ['foo.com'] - ], - 'body' => 'test', - 'version' => '1.0' - ]); - $this->assertEquals('GET', $request->getMethod()); - $this->assertEquals('http://foo.com/', $request->getUrl()); - $this->assertEquals('1.0', $request->getProtocolVersion()); - $this->assertEquals('test', (string) $request->getBody()); - $this->assertEquals('bar', $request->getHeader('foo')); - } - - public function testCanInterceptException() - { - $client = new Client(['base_url' => 'http://127.0.0.1:123']); - $request = $client->createRequest('GET'); - $called = false; - $request->getEmitter()->on( - 'error', - function (ErrorEvent $e) use (&$called) { - $called = true; - $e->intercept(new Response(200)); - } - ); - $request->getConfig()['timeout'] = 0.001; - $request->getConfig()['connect_timeout'] = 0.001; - $this->assertEquals(200, $client->send($request)->getStatusCode()); - $this->assertTrue($called); - } - - public function testCreatesLongException() - { - $r = new Request('GET', 'http://www.google.com'); - $e = RingBridge::getNoRingResponseException($r); - $this->assertInstanceOf('GuzzleHttp\Exception\RequestException', $e); - $this->assertSame($r, $e->getRequest()); - } - - public function testEnsuresResponseOrExceptionWhenCompletingResponse() - { - $trans = new Transaction(new Client(), new Request('GET', 'http://f.co')); - $f = new MessageFactory(); - $fsm = new RequestFsm(function () {}, new MessageFactory()); - try { - RingBridge::completeRingResponse($trans, [], $f, $fsm); - } catch (RequestException $e) { - $this->assertSame($trans->request, $e->getRequest()); - $this->assertContains('RingPHP', $e->getMessage()); - } - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Server.php b/vendor/guzzlehttp/guzzle/tests/Server.php deleted file mode 100644 index 1de20e38..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Server.php +++ /dev/null @@ -1,107 +0,0 @@ -fromMessage($response); - } elseif (!($response instanceof ResponseInterface)) { - throw new \Exception('Responses must be strings or Responses'); - } - $data[] = self::convertResponse($response); - } - - TestServer::enqueue($data); - } - - /** - * Get all of the received requests - * - * @param bool $hydrate Set to TRUE to turn the messages into - * actual {@see RequestInterface} objects. If $hydrate is FALSE, - * requests will be returned as strings. - * - * @return array - * @throws \RuntimeException - */ - public static function received($hydrate = false) - { - $response = TestServer::received(); - - if ($hydrate) { - $c = new Client(); - $factory = new MessageFactory(); - $response = array_map(function($message) use ($factory, $c) { - return RingBridge::fromRingRequest($message); - }, $response); - } - - return $response; - } - - public static function flush() - { - TestServer::flush(); - } - - public static function stop() - { - TestServer::stop(); - } - - public static function wait($maxTries = 5) - { - TestServer::wait($maxTries); - } - - public static function start() - { - TestServer::start(); - } - - private static function convertResponse(Response $response) - { - $headers = array_map(function ($h) { - return implode(', ', $h); - }, $response->getHeaders()); - - return [ - 'status' => $response->getStatusCode(), - 'reason' => $response->getReasonPhrase(), - 'headers' => $headers, - 'body' => base64_encode((string) $response->getBody()) - ]; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php b/vendor/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php deleted file mode 100644 index bc17e2dc..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Subscriber/CookieTest.php +++ /dev/null @@ -1,74 +0,0 @@ -getMockBuilder('GuzzleHttp\Cookie\CookieJar') - ->setMethods(array('extractCookies')) - ->getMock(); - - $mock->expects($this->exactly(1)) - ->method('extractCookies') - ->with($request, $response); - - $plugin = new Cookie($mock); - $t = new Transaction(new Client(), $request); - $t->response = $response; - $plugin->onComplete(new CompleteEvent($t)); - } - - public function testProvidesCookieJar() - { - $jar = new CookieJar(); - $plugin = new Cookie($jar); - $this->assertSame($jar, $plugin->getCookieJar()); - } - - public function testCookiesAreExtractedFromRedirectResponses() - { - $jar = new CookieJar(); - $cookie = new Cookie($jar); - $history = new History(); - $mock = new Mock([ - "HTTP/1.1 302 Moved Temporarily\r\n" . - "Set-Cookie: test=583551; Domain=www.foo.com; Expires=Wednesday, 23-Mar-2050 19:49:45 GMT; Path=/\r\n" . - "Location: /redirect\r\n\r\n", - "HTTP/1.1 200 OK\r\n" . - "Content-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\n" . - "Content-Length: 0\r\n\r\n" - ]); - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach($cookie); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($history); - - $client->get(); - $request = $client->createRequest('GET', '/'); - $client->send($request); - - $this->assertEquals('test=583551', $request->getHeader('Cookie')); - $requests = $history->getRequests(); - // Confirm subsequent requests have the cookie. - $this->assertEquals('test=583551', $requests[2]->getHeader('Cookie')); - // Confirm the redirected request has the cookie. - $this->assertEquals('test=583551', $requests[1]->getHeader('Cookie')); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php b/vendor/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php deleted file mode 100644 index d28e301c..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Subscriber/HistoryTest.php +++ /dev/null @@ -1,140 +0,0 @@ -response = $response; - $e = new RequestException('foo', $request, $response); - $ev = new ErrorEvent($t, $e); - $h = new History(2); - $h->onError($ev); - // Only tracks when no response is present - $this->assertEquals([], $h->getRequests()); - } - - public function testLogsConnectionErrors() - { - $request = new Request('GET', '/'); - $t = new Transaction(new Client(), $request); - $e = new RequestException('foo', $request); - $ev = new ErrorEvent($t, $e); - $h = new History(); - $h->onError($ev); - $this->assertEquals([$request], $h->getRequests()); - } - - public function testMaintainsLimitValue() - { - $request = new Request('GET', '/'); - $response = new Response(200); - $t = new Transaction(new Client(), $request); - $t->response = $response; - $ev = new CompleteEvent($t); - $h = new History(2); - $h->onComplete($ev); - $h->onComplete($ev); - $h->onComplete($ev); - $this->assertEquals(2, count($h)); - $this->assertSame($request, $h->getLastRequest()); - $this->assertSame($response, $h->getLastResponse()); - foreach ($h as $trans) { - $this->assertInstanceOf('GuzzleHttp\Message\RequestInterface', $trans['request']); - $this->assertInstanceOf('GuzzleHttp\Message\ResponseInterface', $trans['response']); - } - return $h; - } - - /** - * @depends testMaintainsLimitValue - */ - public function testClearsHistory($h) - { - $this->assertEquals(2, count($h)); - $h->clear(); - $this->assertEquals(0, count($h)); - } - - public function testWorksWithMock() - { - $client = new Client(['base_url' => 'http://localhost/']); - $h = new History(); - $client->getEmitter()->attach($h); - $mock = new Mock([new Response(200), new Response(201), new Response(202)]); - $client->getEmitter()->attach($mock); - $request = $client->createRequest('GET', '/'); - $client->send($request); - $request->setMethod('PUT'); - $client->send($request); - $request->setMethod('POST'); - $client->send($request); - $this->assertEquals(3, count($h)); - - $result = implode("\n", array_map(function ($line) { - return strpos($line, 'User-Agent') === 0 - ? 'User-Agent:' - : trim($line); - }, explode("\n", $h))); - - $this->assertEquals("> GET / HTTP/1.1 -Host: localhost -User-Agent: - -< HTTP/1.1 200 OK - -> PUT / HTTP/1.1 -Host: localhost -User-Agent: - -< HTTP/1.1 201 Created - -> POST / HTTP/1.1 -Host: localhost -User-Agent: - -< HTTP/1.1 202 Accepted -", $result); - } - - public function testCanCastToString() - { - $client = new Client(['base_url' => 'http://localhost/']); - $h = new History(); - $client->getEmitter()->attach($h); - - $mock = new Mock(array( - new Response(301, array('Location' => '/redirect1', 'Content-Length' => 0)), - new Response(307, array('Location' => '/redirect2', 'Content-Length' => 0)), - new Response(200, array('Content-Length' => '2'), Stream::factory('HI')) - )); - - $client->getEmitter()->attach($mock); - $request = $client->createRequest('GET', '/'); - $client->send($request); - $this->assertEquals(3, count($h)); - - $h = str_replace("\r", '', $h); - $this->assertContains("> GET / HTTP/1.1\nHost: localhost\nUser-Agent:", $h); - $this->assertContains("< HTTP/1.1 301 Moved Permanently\nLocation: /redirect1", $h); - $this->assertContains("< HTTP/1.1 307 Temporary Redirect\nLocation: /redirect2", $h); - $this->assertContains("< HTTP/1.1 200 OK\nContent-Length: 2\n\nHI", $h); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php b/vendor/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php deleted file mode 100644 index b0266340..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Subscriber/HttpErrorTest.php +++ /dev/null @@ -1,60 +0,0 @@ -getEvent(); - $event->intercept(new Response(200)); - (new HttpError())->onComplete($event); - } - - /** - * @expectedException \GuzzleHttp\Exception\ClientException - */ - public function testThrowsClientExceptionOnFailure() - { - $event = $this->getEvent(); - $event->intercept(new Response(403)); - (new HttpError())->onComplete($event); - } - - /** - * @expectedException \GuzzleHttp\Exception\ServerException - */ - public function testThrowsServerExceptionOnFailure() - { - $event = $this->getEvent(); - $event->intercept(new Response(500)); - (new HttpError())->onComplete($event); - } - - private function getEvent() - { - return new CompleteEvent(new Transaction(new Client(), new Request('PUT', '/'))); - } - - /** - * @expectedException \GuzzleHttp\Exception\ClientException - */ - public function testFullTransaction() - { - $client = new Client(); - $client->getEmitter()->attach(new Mock([ - new Response(403) - ])); - $client->get('http://httpbin.org'); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Subscriber/MockTest.php b/vendor/guzzlehttp/guzzle/tests/Subscriber/MockTest.php deleted file mode 100644 index 936edf26..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Subscriber/MockTest.php +++ /dev/null @@ -1,225 +0,0 @@ -promise(), - function () use ($deferred, $wait) { - $deferred->resolve($wait()); - }, - $cancel - ); - } - - public function testDescribesSubscribedEvents() - { - $mock = new Mock(); - $this->assertInternalType('array', $mock->getEvents()); - } - - public function testIsCountable() - { - $plugin = new Mock(); - $plugin->addResponse((new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")); - $this->assertEquals(1, count($plugin)); - } - - public function testCanClearQueue() - { - $plugin = new Mock(); - $plugin->addResponse((new MessageFactory())->fromMessage("HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n")); - $plugin->clearQueue(); - $this->assertEquals(0, count($plugin)); - } - - public function testRetrievesResponsesFromFiles() - { - $tmp = tempnam('/tmp', 'tfile'); - file_put_contents($tmp, "HTTP/1.1 201 OK\r\nContent-Length: 0\r\n\r\n"); - $plugin = new Mock(); - $plugin->addResponse($tmp); - unlink($tmp); - $this->assertEquals(1, count($plugin)); - $q = $this->readAttribute($plugin, 'queue'); - $this->assertEquals(201, $q[0]->getStatusCode()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testThrowsExceptionWhenInvalidResponse() - { - (new Mock())->addResponse(false); - } - - public function testAddsMockResponseToRequestFromClient() - { - $response = new Response(200); - $t = new Transaction(new Client(), new Request('GET', '/')); - $m = new Mock([$response]); - $ev = new BeforeEvent($t); - $m->onBefore($ev); - $this->assertSame($response, $t->response); - } - - /** - * @expectedException \OutOfBoundsException - */ - public function testUpdateThrowsExceptionWhenEmpty() - { - $p = new Mock(); - $ev = new BeforeEvent(new Transaction(new Client(), new Request('GET', '/'))); - $p->onBefore($ev); - } - - public function testReadsBodiesFromMockedRequests() - { - $m = new Mock([new Response(200)]); - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach($m); - $body = Stream::factory('foo'); - $client->put('/', ['body' => $body]); - $this->assertEquals(3, $body->tell()); - } - - public function testCanMockBadRequestExceptions() - { - $client = new Client(['base_url' => 'http://test.com']); - $request = $client->createRequest('GET', '/'); - $ex = new RequestException('foo', $request); - $mock = new Mock([$ex]); - $this->assertCount(1, $mock); - $request->getEmitter()->attach($mock); - - try { - $client->send($request); - $this->fail('Did not dequeue an exception'); - } catch (RequestException $e) { - $this->assertSame($e, $ex); - $this->assertSame($request, $ex->getRequest()); - } - } - - public function testCanMockFutureResponses() - { - $client = new Client(['base_url' => 'http://test.com']); - $request = $client->createRequest('GET', '/', ['future' => true]); - $response = new Response(200); - $future = self::createFuture(function () use ($response) { - return $response; - }); - $mock = new Mock([$future]); - $this->assertCount(1, $mock); - $request->getEmitter()->attach($mock); - $res = $client->send($request); - $this->assertSame($future, $res); - $this->assertFalse($this->readAttribute($res, 'isRealized')); - $this->assertSame($response, $res->wait()); - } - - public function testCanMockExceptionFutureResponses() - { - $client = new Client(['base_url' => 'http://test.com']); - $request = $client->createRequest('GET', '/', ['future' => true]); - $future = self::createFuture(function () use ($request) { - throw new RequestException('foo', $request); - }); - - $mock = new Mock([$future]); - $request->getEmitter()->attach($mock); - $response = $client->send($request); - $this->assertSame($future, $response); - $this->assertFalse($this->readAttribute($response, 'isRealized')); - - try { - $response->wait(); - $this->fail('Did not throw'); - } catch (RequestException $e) { - $this->assertContains('foo', $e->getMessage()); - } - } - - public function testSaveToFile() - { - $filename = sys_get_temp_dir().'/mock_test_'.uniqid(); - $file = tmpfile(); - $stream = new Stream(tmpfile()); - - $m = new Mock([ - new Response(200, [], Stream::factory('TEST FILENAME')), - new Response(200, [], Stream::factory('TEST FILE')), - new Response(200, [], Stream::factory('TEST STREAM')), - ]); - - $client = new Client(); - $client->getEmitter()->attach($m); - - $client->get('/', ['save_to' => $filename]); - $client->get('/', ['save_to' => $file]); - $client->get('/', ['save_to' => $stream]); - - $this->assertFileExists($filename); - $this->assertEquals('TEST FILENAME', file_get_contents($filename)); - - $meta = stream_get_meta_data($file); - - $this->assertFileExists($meta['uri']); - $this->assertEquals('TEST FILE', file_get_contents($meta['uri'])); - - $this->assertFileExists($stream->getMetadata('uri')); - $this->assertEquals('TEST STREAM', file_get_contents($stream->getMetadata('uri'))); - - unlink($filename); - } - - public function testCanMockFailedFutureResponses() - { - $client = new Client(['base_url' => 'http://test.com']); - $request = $client->createRequest('GET', '/', ['future' => true]); - - // The first mock will be a mocked future response. - $future = self::createFuture(function () use ($client) { - // When dereferenced, we will set a mocked response and send - // another request. - $client->get('http://httpbin.org', ['events' => [ - 'before' => function (BeforeEvent $e) { - $e->intercept(new Response(404)); - } - ]]); - }); - - $mock = new Mock([$future]); - $request->getEmitter()->attach($mock); - $response = $client->send($request); - $this->assertSame($future, $response); - $this->assertFalse($this->readAttribute($response, 'isRealized')); - - try { - $response->wait(); - $this->fail('Did not throw'); - } catch (RequestException $e) { - $this->assertEquals(404, $e->getResponse()->getStatusCode()); - } - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php b/vendor/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php deleted file mode 100644 index d07fdb44..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Subscriber/PrepareTest.php +++ /dev/null @@ -1,213 +0,0 @@ -getTrans(); - $s->onBefore(new BeforeEvent($t)); - $this->assertFalse($t->request->hasHeader('Expect')); - } - - public function testAppliesPostBody() - { - $s = new Prepare(); - $t = $this->getTrans(); - $p = $this->getMockBuilder('GuzzleHttp\Post\PostBody') - ->setMethods(['applyRequestHeaders']) - ->getMockForAbstractClass(); - $p->expects($this->once()) - ->method('applyRequestHeaders'); - $t->request->setBody($p); - $s->onBefore(new BeforeEvent($t)); - } - - public function testAddsExpectHeaderWithTrue() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->getConfig()->set('expect', true); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals('100-Continue', $t->request->getHeader('Expect')); - } - - public function testAddsExpectHeaderBySize() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->getConfig()->set('expect', 2); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertTrue($t->request->hasHeader('Expect')); - } - - public function testDoesNotModifyExpectHeaderIfPresent() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setHeader('Expect', 'foo'); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals('foo', $t->request->getHeader('Expect')); - } - - public function testDoesAddExpectHeaderWhenSetToFalse() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->getConfig()->set('expect', false); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertFalse($t->request->hasHeader('Expect')); - } - - public function testDoesNotAddExpectHeaderBySize() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->getConfig()->set('expect', 10); - $t->request->setBody(Stream::factory('foo')); - $s->onBefore(new BeforeEvent($t)); - $this->assertFalse($t->request->hasHeader('Expect')); - } - - public function testAddsExpectHeaderForNonSeekable() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody(new NoSeekStream(Stream::factory('foo'))); - $s->onBefore(new BeforeEvent($t)); - $this->assertTrue($t->request->hasHeader('Expect')); - } - - public function testRemovesContentLengthWhenSendingWithChunked() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody(Stream::factory('foo')); - $t->request->setHeader('Transfer-Encoding', 'chunked'); - $s->onBefore(new BeforeEvent($t)); - $this->assertFalse($t->request->hasHeader('Content-Length')); - } - - public function testUsesProvidedContentLengthAndRemovesXferEncoding() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody(Stream::factory('foo')); - $t->request->setHeader('Content-Length', '3'); - $t->request->setHeader('Transfer-Encoding', 'chunked'); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals(3, $t->request->getHeader('Content-Length')); - $this->assertFalse($t->request->hasHeader('Transfer-Encoding')); - } - - public function testSetsContentTypeIfPossibleFromStream() - { - $body = $this->getMockBody(); - $sub = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody($body); - $sub->onBefore(new BeforeEvent($t)); - $this->assertEquals( - 'image/jpeg', - $t->request->getHeader('Content-Type') - ); - $this->assertEquals(4, $t->request->getHeader('Content-Length')); - } - - public function testDoesNotOverwriteExistingContentType() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody($this->getMockBody()); - $t->request->setHeader('Content-Type', 'foo/baz'); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals( - 'foo/baz', - $t->request->getHeader('Content-Type') - ); - } - - public function testSetsContentLengthIfPossible() - { - $s = new Prepare(); - $t = $this->getTrans(); - $t->request->setBody($this->getMockBody()); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals(4, $t->request->getHeader('Content-Length')); - } - - public function testSetsTransferEncodingChunkedIfNeeded() - { - $r = new Request('PUT', '/'); - $s = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['getSize']) - ->getMockForAbstractClass(); - $s->expects($this->exactly(2)) - ->method('getSize') - ->will($this->returnValue(null)); - $r->setBody($s); - $t = $this->getTrans($r); - $s = new Prepare(); - $s->onBefore(new BeforeEvent($t)); - $this->assertEquals('chunked', $r->getHeader('Transfer-Encoding')); - } - - public function testContentLengthIntegrationTest() - { - Server::flush(); - Server::enqueue([new Response(200)]); - $client = new Client(['base_url' => Server::$url]); - $this->assertEquals(200, $client->put('/', [ - 'body' => 'test' - ])->getStatusCode()); - $request = Server::received(true)[0]; - $this->assertEquals('PUT', $request->getMethod()); - $this->assertEquals('4', $request->getHeader('Content-Length')); - $this->assertEquals('test', (string) $request->getBody()); - } - - private function getTrans($request = null) - { - return new Transaction( - new Client(), - $request ?: new Request('PUT', '/') - ); - } - - /** - * @return \GuzzleHttp\Stream\StreamInterface - */ - private function getMockBody() - { - $s = $this->getMockBuilder('GuzzleHttp\Stream\MetadataStreamInterface') - ->setMethods(['getMetadata', 'getSize']) - ->getMockForAbstractClass(); - $s->expects($this->any()) - ->method('getMetadata') - ->with('uri') - ->will($this->returnValue('/foo/baz/bar.jpg')); - $s->expects($this->exactly(2)) - ->method('getSize') - ->will($this->returnValue(4)); - - return $s; - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php b/vendor/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php deleted file mode 100644 index bd12af75..00000000 --- a/vendor/guzzlehttp/guzzle/tests/Subscriber/RedirectTest.php +++ /dev/null @@ -1,302 +0,0 @@ -addMultiple([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach($history); - $client->getEmitter()->attach($mock); - - $request = $client->createRequest('GET', '/foo'); - // Ensure "end" is called only once - $called = 0; - $request->getEmitter()->on('end', function () use (&$called) { - $called++; - }); - $response = $client->send($request); - - $this->assertEquals(200, $response->getStatusCode()); - $this->assertContains('/redirect2', $response->getEffectiveUrl()); - - // Ensure that two requests were sent - $requests = $history->getRequests(true); - - $this->assertEquals('/foo', $requests[0]->getPath()); - $this->assertEquals('GET', $requests[0]->getMethod()); - $this->assertEquals('/redirect1', $requests[1]->getPath()); - $this->assertEquals('GET', $requests[1]->getMethod()); - $this->assertEquals('/redirect2', $requests[2]->getPath()); - $this->assertEquals('GET', $requests[2]->getMethod()); - - $this->assertEquals(1, $called); - } - - /** - * @expectedException \GuzzleHttp\Exception\TooManyRedirectsException - * @expectedExceptionMessage Will not follow more than - */ - public function testCanLimitNumberOfRedirects() - { - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect2\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect3\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect4\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect5\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect6\r\nContent-Length: 0\r\n\r\n" - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->get('http://www.example.com/foo'); - } - - public function testDefaultBehaviorIsToRedirectWithGetForEntityEnclosingRequests() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - $client->post('http://test.com/foo', [ - 'headers' => ['X-Baz' => 'bar'], - 'body' => 'testing' - ]); - - $requests = $h->getRequests(true); - $this->assertEquals('POST', $requests[0]->getMethod()); - $this->assertEquals('GET', $requests[1]->getMethod()); - $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz')); - $this->assertEquals('GET', $requests[2]->getMethod()); - } - - public function testCanRedirectWithStrictRfcCompliance() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - $client->post('/foo', [ - 'headers' => ['X-Baz' => 'bar'], - 'body' => 'testing', - 'allow_redirects' => ['max' => 10, 'strict' => true] - ]); - - $requests = $h->getRequests(true); - $this->assertEquals('POST', $requests[0]->getMethod()); - $this->assertEquals('POST', $requests[1]->getMethod()); - $this->assertEquals('bar', (string) $requests[1]->getHeader('X-Baz')); - $this->assertEquals('POST', $requests[2]->getMethod()); - } - - public function testRewindsStreamWhenRedirectingIfNeeded() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - - $body = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['seek', 'read', 'eof', 'tell']) - ->getMockForAbstractClass(); - $body->expects($this->once())->method('tell')->will($this->returnValue(1)); - $body->expects($this->once())->method('seek')->will($this->returnValue(true)); - $body->expects($this->any())->method('eof')->will($this->returnValue(true)); - $body->expects($this->any())->method('read')->will($this->returnValue('foo')); - $client->post('/foo', [ - 'body' => $body, - 'allow_redirects' => ['max' => 5, 'strict' => true] - ]); - } - - /** - * @expectedException \GuzzleHttp\Exception\CouldNotRewindStreamException - * @expectedExceptionMessage Unable to rewind the non-seekable request body after redirecting - */ - public function testThrowsExceptionWhenStreamCannotBeRewound() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - - $body = $this->getMockBuilder('GuzzleHttp\Stream\StreamInterface') - ->setMethods(['seek', 'read', 'eof', 'tell']) - ->getMockForAbstractClass(); - $body->expects($this->once())->method('tell')->will($this->returnValue(1)); - $body->expects($this->once())->method('seek')->will($this->returnValue(false)); - $body->expects($this->any())->method('eof')->will($this->returnValue(true)); - $body->expects($this->any())->method('read')->will($this->returnValue('foo')); - $client->post('http://example.com/foo', [ - 'body' => $body, - 'allow_redirects' => ['max' => 10, 'strict' => true] - ]); - } - - public function testRedirectsCanBeDisabledPerRequest() - { - $client = new Client(['base_url' => 'http://test.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ])); - $response = $client->put('/', ['body' => 'test', 'allow_redirects' => false]); - $this->assertEquals(301, $response->getStatusCode()); - } - - public function testCanRedirectWithNoLeadingSlashAndQuery() - { - $h = new History(); - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect?foo=bar\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ])); - $client->getEmitter()->attach($h); - $client->get('?foo=bar'); - $requests = $h->getRequests(true); - $this->assertEquals('http://www.foo.com?foo=bar', $requests[0]->getUrl()); - $this->assertEquals('http://www.foo.com/redirect?foo=bar', $requests[1]->getUrl()); - } - - public function testHandlesRedirectsWithSpacesProperly() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect 1\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $h = new History(); - $client->getEmitter()->attach($h); - $client->get('/foo'); - $reqs = $h->getRequests(true); - $this->assertEquals('/redirect%201', $reqs[1]->getResource()); - } - - public function testAddsRefererWhenPossible() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /bar\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $h = new History(); - $client->getEmitter()->attach($h); - $client->get('/foo', ['allow_redirects' => ['max' => 5, 'referer' => true]]); - $reqs = $h->getRequests(true); - $this->assertEquals('http://www.foo.com/foo', $reqs[1]->getHeader('Referer')); - } - - public function testDoesNotAddRefererWhenChangingProtocols() - { - $client = new Client(['base_url' => 'https://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\n" - . "Location: http://www.foo.com/foo\r\n" - . "Content-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $h = new History(); - $client->getEmitter()->attach($h); - $client->get('/foo', ['allow_redirects' => ['max' => 5, 'referer' => true]]); - $reqs = $h->getRequests(true); - $this->assertFalse($reqs[1]->hasHeader('Referer')); - } - - public function testRedirectsWithGetOn303() - { - $h = new History(); - $mock = new Mock([ - "HTTP/1.1 303 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n", - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->getEmitter()->attach($h); - $client->post('http://test.com/foo', ['body' => 'testing']); - $requests = $h->getRequests(true); - $this->assertEquals('POST', $requests[0]->getMethod()); - $this->assertEquals('GET', $requests[1]->getMethod()); - } - - public function testRelativeLinkBasedLatestRequest() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: http://www.bar.com\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $response = $client->get('/'); - $this->assertEquals( - 'http://www.bar.com/redirect', - $response->getEffectiveUrl() - ); - } - - public function testUpperCaseScheme() - { - $client = new Client(['base_url' => 'http://www.foo.com']); - $client->getEmitter()->attach(new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: HTTP://www.bar.com\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n" - ])); - $response = $client->get('/'); - $this->assertEquals( - 'http://www.bar.com', - $response->getEffectiveUrl() - ); - } - - /** - * @expectedException \GuzzleHttp\Exception\BadResponseException - * @expectedExceptionMessage Redirect URL, https://foo.com/redirect2, does not use one of the allowed redirect protocols: http - */ - public function testThrowsWhenRedirectingToInvalidUrlProtocol() - { - $mock = new Mock([ - "HTTP/1.1 301 Moved Permanently\r\nLocation: /redirect1\r\nContent-Length: 0\r\n\r\n", - "HTTP/1.1 301 Moved Permanently\r\nLocation: https://foo.com/redirect2\r\nContent-Length: 0\r\n\r\n" - ]); - $client = new Client(); - $client->getEmitter()->attach($mock); - $client->get('http://www.example.com/foo', [ - 'allow_redirects' => [ - 'protocols' => ['http'] - ] - ]); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/TransactionTest.php b/vendor/guzzlehttp/guzzle/tests/TransactionTest.php deleted file mode 100644 index 42965b1b..00000000 --- a/vendor/guzzlehttp/guzzle/tests/TransactionTest.php +++ /dev/null @@ -1,22 +0,0 @@ -assertSame($client, $t->client); - $this->assertSame($request, $t->request); - $response = new Response(200); - $t->response = $response; - $this->assertSame($response, $t->response); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php b/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php deleted file mode 100644 index 3f7a7f06..00000000 --- a/vendor/guzzlehttp/guzzle/tests/UriTemplateTest.php +++ /dev/null @@ -1,202 +0,0 @@ - 'value', - 'hello' => 'Hello World!', - 'empty' => '', - 'path' => '/foo/bar', - 'x' => '1024', - 'y' => '768', - 'null' => null, - 'list' => array('red', 'green', 'blue'), - 'keys' => array( - "semi" => ';', - "dot" => '.', - "comma" => ',' - ), - 'empty_keys' => array(), - ); - - return array_map(function ($t) use ($params) { - $t[] = $params; - return $t; - }, array( - array('foo', 'foo'), - array('{var}', 'value'), - array('{hello}', 'Hello%20World%21'), - array('{+var}', 'value'), - array('{+hello}', 'Hello%20World!'), - array('{+path}/here', '/foo/bar/here'), - array('here?ref={+path}', 'here?ref=/foo/bar'), - array('X{#var}', 'X#value'), - array('X{#hello}', 'X#Hello%20World!'), - array('map?{x,y}', 'map?1024,768'), - array('{x,hello,y}', '1024,Hello%20World%21,768'), - array('{+x,hello,y}', '1024,Hello%20World!,768'), - array('{+path,x}/here', '/foo/bar,1024/here'), - array('{#x,hello,y}', '#1024,Hello%20World!,768'), - array('{#path,x}/here', '#/foo/bar,1024/here'), - array('X{.var}', 'X.value'), - array('X{.x,y}', 'X.1024.768'), - array('{/var}', '/value'), - array('{/var,x}/here', '/value/1024/here'), - array('{;x,y}', ';x=1024;y=768'), - array('{;x,y,empty}', ';x=1024;y=768;empty'), - array('{?x,y}', '?x=1024&y=768'), - array('{?x,y,empty}', '?x=1024&y=768&empty='), - array('?fixed=yes{&x}', '?fixed=yes&x=1024'), - array('{&x,y,empty}', '&x=1024&y=768&empty='), - array('{var:3}', 'val'), - array('{var:30}', 'value'), - array('{list}', 'red,green,blue'), - array('{list*}', 'red,green,blue'), - array('{keys}', 'semi,%3B,dot,.,comma,%2C'), - array('{keys*}', 'semi=%3B,dot=.,comma=%2C'), - array('{+path:6}/here', '/foo/b/here'), - array('{+list}', 'red,green,blue'), - array('{+list*}', 'red,green,blue'), - array('{+keys}', 'semi,;,dot,.,comma,,'), - array('{+keys*}', 'semi=;,dot=.,comma=,'), - array('{#path:6}/here', '#/foo/b/here'), - array('{#list}', '#red,green,blue'), - array('{#list*}', '#red,green,blue'), - array('{#keys}', '#semi,;,dot,.,comma,,'), - array('{#keys*}', '#semi=;,dot=.,comma=,'), - array('X{.var:3}', 'X.val'), - array('X{.list}', 'X.red,green,blue'), - array('X{.list*}', 'X.red.green.blue'), - array('X{.keys}', 'X.semi,%3B,dot,.,comma,%2C'), - array('X{.keys*}', 'X.semi=%3B.dot=..comma=%2C'), - array('{/var:1,var}', '/v/value'), - array('{/list}', '/red,green,blue'), - array('{/list*}', '/red/green/blue'), - array('{/list*,path:4}', '/red/green/blue/%2Ffoo'), - array('{/keys}', '/semi,%3B,dot,.,comma,%2C'), - array('{/keys*}', '/semi=%3B/dot=./comma=%2C'), - array('{;hello:5}', ';hello=Hello'), - array('{;list}', ';list=red,green,blue'), - array('{;list*}', ';list=red;list=green;list=blue'), - array('{;keys}', ';keys=semi,%3B,dot,.,comma,%2C'), - array('{;keys*}', ';semi=%3B;dot=.;comma=%2C'), - array('{?var:3}', '?var=val'), - array('{?list}', '?list=red,green,blue'), - array('{?list*}', '?list=red&list=green&list=blue'), - array('{?keys}', '?keys=semi,%3B,dot,.,comma,%2C'), - array('{?keys*}', '?semi=%3B&dot=.&comma=%2C'), - array('{&var:3}', '&var=val'), - array('{&list}', '&list=red,green,blue'), - array('{&list*}', '&list=red&list=green&list=blue'), - array('{&keys}', '&keys=semi,%3B,dot,.,comma,%2C'), - array('{&keys*}', '&semi=%3B&dot=.&comma=%2C'), - array('{.null}', ''), - array('{.null,var}', '.value'), - array('X{.empty_keys*}', 'X'), - array('X{.empty_keys}', 'X'), - // Test that missing expansions are skipped - array('test{&missing*}', 'test'), - // Test that multiple expansions can be set - array('http://{var}/{var:2}{?keys*}', 'http://value/va?semi=%3B&dot=.&comma=%2C'), - // Test more complex query string stuff - array('http://www.test.com{+path}{?var,keys*}', 'http://www.test.com/foo/bar?var=value&semi=%3B&dot=.&comma=%2C') - )); - } - - /** - * @dataProvider templateProvider - */ - public function testExpandsUriTemplates($template, $expansion, $params) - { - $uri = new UriTemplate($template); - $this->assertEquals($expansion, $uri->expand($template, $params)); - } - - public function expressionProvider() - { - return array( - array( - '{+var*}', array( - 'operator' => '+', - 'values' => array( - array('value' => 'var', 'modifier' => '*') - ) - ), - ), - array( - '{?keys,var,val}', array( - 'operator' => '?', - 'values' => array( - array('value' => 'keys', 'modifier' => ''), - array('value' => 'var', 'modifier' => ''), - array('value' => 'val', 'modifier' => '') - ) - ), - ), - array( - '{+x,hello,y}', array( - 'operator' => '+', - 'values' => array( - array('value' => 'x', 'modifier' => ''), - array('value' => 'hello', 'modifier' => ''), - array('value' => 'y', 'modifier' => '') - ) - ) - ) - ); - } - - /** - * @dataProvider expressionProvider - */ - public function testParsesExpressions($exp, $data) - { - $template = new UriTemplate($exp); - - // Access the config object - $class = new \ReflectionClass($template); - $method = $class->getMethod('parseExpression'); - $method->setAccessible(true); - - $exp = substr($exp, 1, -1); - $this->assertEquals($data, $method->invokeArgs($template, array($exp))); - } - - /** - * @ticket https://github.com/guzzle/guzzle/issues/90 - */ - public function testAllowsNestedArrayExpansion() - { - $template = new UriTemplate(); - - $result = $template->expand('http://example.com{+path}{/segments}{?query,data*,foo*}', array( - 'path' => '/foo/bar', - 'segments' => array('one', 'two'), - 'query' => 'test', - 'data' => array( - 'more' => array('fun', 'ice cream') - ), - 'foo' => array( - 'baz' => array( - 'bar' => 'fizz', - 'test' => 'buzz' - ), - 'bam' => 'boo' - ) - )); - - $this->assertEquals('http://example.com/foo/bar/one,two?query=test&more%5B0%5D=fun&more%5B1%5D=ice%20cream&baz%5Bbar%5D=fizz&baz%5Btest%5D=buzz&bam=boo', $result); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/UrlTest.php b/vendor/guzzlehttp/guzzle/tests/UrlTest.php deleted file mode 100644 index 22bf7e49..00000000 --- a/vendor/guzzlehttp/guzzle/tests/UrlTest.php +++ /dev/null @@ -1,364 +0,0 @@ -assertEquals('', (string) $url); - } - - public function testPortIsDeterminedFromScheme() - { - $this->assertEquals(80, Url::fromString('http://www.test.com/')->getPort()); - $this->assertEquals(443, Url::fromString('https://www.test.com/')->getPort()); - $this->assertEquals(21, Url::fromString('ftp://www.test.com/')->getPort()); - $this->assertEquals(8192, Url::fromString('http://www.test.com:8192/')->getPort()); - $this->assertEquals(null, Url::fromString('foo://www.test.com/')->getPort()); - } - - public function testRemovesDefaultPortWhenSettingScheme() - { - $url = Url::fromString('http://www.test.com/'); - $url->setPort(80); - $url->setScheme('https'); - $this->assertEquals(443, $url->getPort()); - } - - public function testCloneCreatesNewInternalObjects() - { - $u1 = Url::fromString('http://www.test.com/'); - $u2 = clone $u1; - $this->assertNotSame($u1->getQuery(), $u2->getQuery()); - } - - public function testValidatesUrlPartsInFactory() - { - $url = Url::fromString('/index.php'); - $this->assertEquals('/index.php', (string) $url); - $this->assertFalse($url->isAbsolute()); - - $url = 'http://michael:test@test.com:80/path/123?q=abc#test'; - $u = Url::fromString($url); - $this->assertEquals('http://michael:test@test.com/path/123?q=abc#test', (string) $u); - $this->assertTrue($u->isAbsolute()); - } - - public function testAllowsFalsyUrlParts() - { - $url = Url::fromString('http://a:50/0?0#0'); - $this->assertSame('a', $url->getHost()); - $this->assertEquals(50, $url->getPort()); - $this->assertSame('/0', $url->getPath()); - $this->assertEquals('0', (string) $url->getQuery()); - $this->assertSame('0', $url->getFragment()); - $this->assertEquals('http://a:50/0?0#0', (string) $url); - - $url = Url::fromString(''); - $this->assertSame('', (string) $url); - - $url = Url::fromString('0'); - $this->assertSame('0', (string) $url); - } - - public function testBuildsRelativeUrlsWithFalsyParts() - { - $url = Url::buildUrl(['path' => '/0']); - $this->assertSame('/0', $url); - - $url = Url::buildUrl(['path' => '0']); - $this->assertSame('0', $url); - - $url = Url::buildUrl(['host' => '', 'path' => '0']); - $this->assertSame('0', $url); - } - - public function testUrlStoresParts() - { - $url = Url::fromString('http://test:pass@www.test.com:8081/path/path2/?a=1&b=2#fragment'); - $this->assertEquals('http', $url->getScheme()); - $this->assertEquals('test', $url->getUsername()); - $this->assertEquals('pass', $url->getPassword()); - $this->assertEquals('www.test.com', $url->getHost()); - $this->assertEquals(8081, $url->getPort()); - $this->assertEquals('/path/path2/', $url->getPath()); - $this->assertEquals('fragment', $url->getFragment()); - $this->assertEquals('a=1&b=2', (string) $url->getQuery()); - - $this->assertEquals(array( - 'fragment' => 'fragment', - 'host' => 'www.test.com', - 'pass' => 'pass', - 'path' => '/path/path2/', - 'port' => 8081, - 'query' => 'a=1&b=2', - 'scheme' => 'http', - 'user' => 'test' - ), $url->getParts()); - } - - public function testHandlesPathsCorrectly() - { - $url = Url::fromString('http://www.test.com'); - $this->assertEquals('', $url->getPath()); - $url->setPath('test'); - $this->assertEquals('test', $url->getPath()); - - $url->setPath('/test/123/abc'); - $this->assertEquals(array('', 'test', '123', 'abc'), $url->getPathSegments()); - - $parts = parse_url('http://www.test.com/test'); - $parts['path'] = ''; - $this->assertEquals('http://www.test.com', Url::buildUrl($parts)); - $parts['path'] = 'test'; - $this->assertEquals('http://www.test.com/test', Url::buildUrl($parts)); - } - - public function testAddsQueryIfPresent() - { - $this->assertEquals('?foo=bar', Url::buildUrl(array( - 'query' => 'foo=bar' - ))); - } - - public function testAddsToPath() - { - // Does nothing here - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath(false); - $this->assertEquals('http://e.com/base?a=1', $url); - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath(''); - $this->assertEquals('http://e.com/base?a=1', $url); - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath('/'); - $this->assertEquals('http://e.com/base?a=1', $url); - $url = Url::fromString('http://e.com/base'); - $url->addPath('0'); - $this->assertEquals('http://e.com/base/0', $url); - - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath('relative'); - $this->assertEquals('http://e.com/base/relative?a=1', $url); - $url = Url::fromString('http://e.com/base?a=1'); - $url->addPath('/relative'); - $this->assertEquals('http://e.com/base/relative?a=1', $url); - } - - /** - * URL combination data provider - * - * @return array - */ - public function urlCombineDataProvider() - { - return [ - // Specific test cases - ['http://www.example.com/', 'http://www.example.com/', 'http://www.example.com/'], - ['http://www.example.com/path', '/absolute', 'http://www.example.com/absolute'], - ['http://www.example.com/path', '/absolute?q=2', 'http://www.example.com/absolute?q=2'], - ['http://www.example.com/', '?q=1', 'http://www.example.com/?q=1'], - ['http://www.example.com/path', 'http://test.com', 'http://test.com'], - ['http://www.example.com:8080/path', 'http://test.com', 'http://test.com'], - ['http://www.example.com:8080/path', '?q=2#abc', 'http://www.example.com:8080/path?q=2#abc'], - ['http://www.example.com/path', 'http://u:a@www.example.com/', 'http://u:a@www.example.com/'], - ['/path?q=2', 'http://www.test.com/', 'http://www.test.com/path?q=2'], - ['http://api.flickr.com/services/', 'http://www.flickr.com/services/oauth/access_token', 'http://www.flickr.com/services/oauth/access_token'], - ['https://www.example.com/path', '//foo.com/abc', 'https://foo.com/abc'], - ['https://www.example.com/0/', 'relative/foo', 'https://www.example.com/0/relative/foo'], - ['', '0', '0'], - // RFC 3986 test cases - [self::RFC3986_BASE, 'g:h', 'g:h'], - [self::RFC3986_BASE, 'g', 'http://a/b/c/g'], - [self::RFC3986_BASE, './g', 'http://a/b/c/g'], - [self::RFC3986_BASE, 'g/', 'http://a/b/c/g/'], - [self::RFC3986_BASE, '/g', 'http://a/g'], - [self::RFC3986_BASE, '//g', 'http://g'], - [self::RFC3986_BASE, '?y', 'http://a/b/c/d;p?y'], - [self::RFC3986_BASE, 'g?y', 'http://a/b/c/g?y'], - [self::RFC3986_BASE, '#s', 'http://a/b/c/d;p?q#s'], - [self::RFC3986_BASE, 'g#s', 'http://a/b/c/g#s'], - [self::RFC3986_BASE, 'g?y#s', 'http://a/b/c/g?y#s'], - [self::RFC3986_BASE, ';x', 'http://a/b/c/;x'], - [self::RFC3986_BASE, 'g;x', 'http://a/b/c/g;x'], - [self::RFC3986_BASE, 'g;x?y#s', 'http://a/b/c/g;x?y#s'], - [self::RFC3986_BASE, '', self::RFC3986_BASE], - [self::RFC3986_BASE, '.', 'http://a/b/c/'], - [self::RFC3986_BASE, './', 'http://a/b/c/'], - [self::RFC3986_BASE, '..', 'http://a/b/'], - [self::RFC3986_BASE, '../', 'http://a/b/'], - [self::RFC3986_BASE, '../g', 'http://a/b/g'], - [self::RFC3986_BASE, '../..', 'http://a/'], - [self::RFC3986_BASE, '../../', 'http://a/'], - [self::RFC3986_BASE, '../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../g', 'http://a/g'], - [self::RFC3986_BASE, '../../../../g', 'http://a/g'], - [self::RFC3986_BASE, '/./g', 'http://a/g'], - [self::RFC3986_BASE, '/../g', 'http://a/g'], - [self::RFC3986_BASE, 'g.', 'http://a/b/c/g.'], - [self::RFC3986_BASE, '.g', 'http://a/b/c/.g'], - [self::RFC3986_BASE, 'g..', 'http://a/b/c/g..'], - [self::RFC3986_BASE, '..g', 'http://a/b/c/..g'], - [self::RFC3986_BASE, './../g', 'http://a/b/g'], - [self::RFC3986_BASE, 'foo////g', 'http://a/b/c/foo////g'], - [self::RFC3986_BASE, './g/.', 'http://a/b/c/g/'], - [self::RFC3986_BASE, 'g/./h', 'http://a/b/c/g/h'], - [self::RFC3986_BASE, 'g/../h', 'http://a/b/c/h'], - [self::RFC3986_BASE, 'g;x=1/./y', 'http://a/b/c/g;x=1/y'], - [self::RFC3986_BASE, 'g;x=1/../y', 'http://a/b/c/y'], - [self::RFC3986_BASE, 'http:g', 'http:g'], - ]; - } - - /** - * @dataProvider urlCombineDataProvider - */ - public function testCombinesUrls($a, $b, $c) - { - $this->assertEquals($c, (string) Url::fromString($a)->combine($b)); - } - - public function testHasGettersAndSetters() - { - $url = Url::fromString('http://www.test.com/'); - $url->setHost('example.com'); - $this->assertEquals('example.com', $url->getHost()); - $url->setPort(8080); - $this->assertEquals('8080', $url->getPort()); - $url->setPath('/foo/bar'); - $this->assertEquals('/foo/bar', $url->getPath()); - $url->setPassword('a'); - $this->assertEquals('a', $url->getPassword()); - $url->setUsername('b'); - $this->assertEquals('b', $url->getUsername()); - $url->setFragment('abc'); - $this->assertEquals('abc', $url->getFragment()); - $url->setScheme('https'); - $this->assertEquals('https', $url->getScheme()); - $url->setQuery('a=123'); - $this->assertEquals('a=123', (string) $url->getQuery()); - $this->assertEquals( - 'https://b:a@example.com:8080/foo/bar?a=123#abc', - (string) $url - ); - $url->setQuery(new Query(['b' => 'boo'])); - $this->assertEquals('b=boo', $url->getQuery()); - $this->assertEquals( - 'https://b:a@example.com:8080/foo/bar?b=boo#abc', - (string) $url - ); - - $url->setQuery('a%20=bar!', true); - $this->assertEquals( - 'https://b:a@example.com:8080/foo/bar?a%20=bar!#abc', - (string) $url - ); - } - - public function testSetQueryAcceptsArray() - { - $url = Url::fromString('http://www.test.com'); - $url->setQuery(array('a' => 'b')); - $this->assertEquals('http://www.test.com?a=b', (string) $url); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testQueryMustBeValid() - { - $url = Url::fromString('http://www.test.com'); - $url->setQuery(false); - } - - public function testDefersParsingAndEncodingQueryUntilNecessary() - { - $url = Url::fromString('http://www.test.com'); - // Note that invalid characters are encoded. - $url->setQuery('foo#bar/', true); - $this->assertEquals('http://www.test.com?foo%23bar/', (string) $url); - $this->assertInternalType('string', $this->readAttribute($url, 'query')); - $this->assertEquals('foo%23bar%2F', (string) $url->getQuery()); - $this->assertInstanceOf('GuzzleHttp\Query', $this->readAttribute($url, 'query')); - } - - public function urlProvider() - { - return array( - array('/foo/..', '/'), - array('//foo//..', '//foo/'), - array('/foo//', '/foo//'), - array('/foo/../..', '/'), - array('/foo/../.', '/'), - array('/./foo/..', '/'), - array('/./foo', '/foo'), - array('/./foo/', '/foo/'), - array('*', '*'), - array('/foo', '/foo'), - array('/abc/123/../foo/', '/abc/foo/'), - array('/a/b/c/./../../g', '/a/g'), - array('/b/c/./../../g', '/g'), - array('/b/c/./../../g', '/g'), - array('/c/./../../g', '/g'), - array('/./../../g', '/g'), - array('foo', 'foo'), - ); - } - - /** - * @dataProvider urlProvider - */ - public function testRemoveDotSegments($path, $result) - { - $url = Url::fromString('http://www.example.com'); - $url->setPath($path); - $url->removeDotSegments(); - $this->assertEquals($result, $url->getPath()); - } - - public function testSettingHostWithPortModifiesPort() - { - $url = Url::fromString('http://www.example.com'); - $url->setHost('foo:8983'); - $this->assertEquals('foo', $url->getHost()); - $this->assertEquals(8983, $url->getPort()); - } - - /** - * @expectedException \InvalidArgumentException - */ - public function testValidatesUrlCanBeParsed() - { - Url::fromString('foo:////'); - } - - public function testConvertsSpecialCharsInPathWhenCastingToString() - { - $url = Url::fromString('http://foo.com/baz bar?a=b'); - $url->addPath('?'); - $this->assertEquals('http://foo.com/baz%20bar/%3F?a=b', (string) $url); - } - - public function testCorrectlyEncodesPathWithoutDoubleEncoding() - { - $url = Url::fromString('http://foo.com/baz%20 bar:boo/baz!'); - $this->assertEquals('/baz%20%20bar:boo/baz!', $url->getPath()); - } - - public function testLowercaseScheme() - { - $url = Url::fromString('HTTP://foo.com/'); - $this->assertEquals('http', $url->getScheme()); - $url->setScheme('HTTPS'); - $this->assertEquals('https', $url->getScheme()); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/UtilsTest.php b/vendor/guzzlehttp/guzzle/tests/UtilsTest.php deleted file mode 100644 index 10bdc545..00000000 --- a/vendor/guzzlehttp/guzzle/tests/UtilsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertEquals( - 'foo/123', - Utils::uriTemplate('foo/{bar}', ['bar' => '123']) - ); - } - - public function noBodyProvider() - { - return [['get'], ['head'], ['delete']]; - } - - public function testJsonDecodes() - { - $this->assertTrue(Utils::jsonDecode('true')); - } - - /** - * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Unable to parse JSON data: JSON_ERROR_SYNTAX - Syntax error, malformed JSON - */ - public function testJsonDecodesWithErrorMessages() - { - Utils::jsonDecode('!narf!'); - } - - public function testProvidesDefaultUserAgent() - { - $ua = Utils::getDefaultUserAgent(); - $this->assertEquals(1, preg_match('#^Guzzle/.+ curl/.+ PHP/.+$#', $ua)); - } -} diff --git a/vendor/guzzlehttp/guzzle/tests/bootstrap.php b/vendor/guzzlehttp/guzzle/tests/bootstrap.php deleted file mode 100644 index 8713f962..00000000 --- a/vendor/guzzlehttp/guzzle/tests/bootstrap.php +++ /dev/null @@ -1,11 +0,0 @@ - Server::$url]); - -$t = microtime(true); -for ($i = 0; $i < $total; $i++) { - $client->get('/guzzle-server/perf'); -} -$totalTime = microtime(true) - $t; -$perRequest = ($totalTime / $total) * 1000; -printf("Serial: %f (%f ms / request) %d total\n", - $totalTime, $perRequest, $total); - -// Create a generator used to yield batches of requests -$reqs = function () use ($client, $total) { - for ($i = 0; $i < $total; $i++) { - yield $client->createRequest('GET', '/guzzle-server/perf'); - } -}; - -$t = microtime(true); -Pool::send($client, $reqs(), ['parallel' => $parallel]); -$totalTime = microtime(true) - $t; -$perRequest = ($totalTime / $total) * 1000; -printf("Batch: %f (%f ms / request) %d total with %d in parallel\n", - $totalTime, $perRequest, $total, $parallel); - -$handler = new CurlMultiHandler(['max_handles' => $parallel]); -$client = new Client(['handler' => $handler, 'base_url' => Server::$url]); -$t = microtime(true); -for ($i = 0; $i < $total; $i++) { - $client->get('/guzzle-server/perf'); -} -unset($client); -$totalTime = microtime(true) - $t; -$perRequest = ($totalTime / $total) * 1000; -printf("Future: %f (%f ms / request) %d total\n", - $totalTime, $perRequest, $total); diff --git a/vendor/phpdocumentor/reflection-common/.gitignore b/vendor/phpdocumentor/reflection-common/.gitignore new file mode 100644 index 00000000..c56f6719 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/.gitignore @@ -0,0 +1,4 @@ +composer.phar +vendor/ +build/ + diff --git a/vendor/phpdocumentor/reflection-common/LICENSE b/vendor/phpdocumentor/reflection-common/LICENSE new file mode 100644 index 00000000..ed6926c1 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 phpDocumentor + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/vendor/phpdocumentor/reflection-common/README.md b/vendor/phpdocumentor/reflection-common/README.md new file mode 100644 index 00000000..52b12bc0 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/README.md @@ -0,0 +1 @@ +# ReflectionCommon diff --git a/vendor/phpdocumentor/reflection-common/composer.json b/vendor/phpdocumentor/reflection-common/composer.json new file mode 100644 index 00000000..90eee0f0 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/composer.json @@ -0,0 +1,29 @@ +{ + "name": "phpdocumentor/reflection-common", + "keywords": ["phpdoc", "phpDocumentor", "reflection", "static analysis", "FQSEN"], + "homepage": "http://www.phpdoc.org", + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "license": "MIT", + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "require": { + "php": ">=5.5" + }, + "autoload" : { + "psr-4" : { + "phpDocumentor\\Reflection\\": ["src"] + } + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/phpdocumentor/reflection-common/composer.lock b/vendor/phpdocumentor/reflection-common/composer.lock new file mode 100644 index 00000000..e01dc3c1 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/composer.lock @@ -0,0 +1,974 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "hash": "49ee00389e4ccd00d7e93a147103b2ab", + "packages": [], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/f976e5de371104877ebc89bd8fecb0019ed9c119", + "reference": "f976e5de371104877ebc89bd8fecb0019ed9c119", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "2.0.*@ALPHA" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "Doctrine\\Instantiator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2014-10-13 12:58:55" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", + "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "dflydev/markdown": "~1.0", + "erusev/parsedown": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-0": { + "phpDocumentor": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "mike.vanriel@naenius.com" + } + ], + "time": "2015-02-03 12:10:50" + }, + { + "name": "phpspec/prophecy", + "version": "v1.4.1", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "reference": "3132b1f44c7bf2ec4c7eb2d3cb78fdeca760d373", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "phpdocumentor/reflection-docblock": "~2.0", + "sebastian/comparator": "~1.1" + }, + "require-dev": { + "phpspec/phpspec": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2015-04-27 22:15:08" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.1.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "6b7d2094ca2a685a2cad846cb7cd7a30e8b9470f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6b7d2094ca2a685a2cad846cb7cd7a30e8b9470f", + "reference": "6b7d2094ca2a685a2cad846cb7cd7a30e8b9470f", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "~1.0", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2015-06-01 07:35:26" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a923bb15680d0089e2316f7a4af8f437046e96bb", + "reference": "a923bb15680d0089e2316f7a4af8f437046e96bb", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2015-04-02 05:19:05" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "Text/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2014-01-30 17:20:04" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHP/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2013-08-02 07:42:54" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "eab81d02569310739373308137284e0158424330" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/eab81d02569310739373308137284e0158424330", + "reference": "eab81d02569310739373308137284e0158424330", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2015-04-08 04:46:07" + }, + { + "name": "phpunit/phpunit", + "version": "4.6.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "816d12536a7a032adc3b68737f82cfbbf98b79c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/816d12536a7a032adc3b68737f82cfbbf98b79c1", + "reference": "816d12536a7a032adc3b68737f82cfbbf98b79c1", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "~1.3,>=1.3.1", + "phpunit/php-code-coverage": "~2.0,>=2.0.11", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "~1.0", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.1", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.2", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.6.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2015-05-29 06:00:03" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "253c005852591fd547fc18cd5b7b43a1ec82d8f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/253c005852591fd547fc18cd5b7b43a1ec82d8f7", + "reference": "253c005852591fd547fc18cd5b7b43a1ec82d8f7", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "~1.0,>=1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2015-05-29 05:19:18" + }, + { + "name": "sebastian/comparator", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2015-01-29 16:28:08" + }, + { + "name": "sebastian/diff", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "http://www.github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2015-02-22 15:13:53" + }, + { + "name": "sebastian/environment", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", + "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2015-01-01 10:01:08" + }, + { + "name": "sebastian/exporter", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "84839970d05254c73cde183a721c7af13aede943" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", + "reference": "84839970d05254c73cde183a721c7af13aede943", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2015-01-27 07:23:06" + }, + { + "name": "sebastian/global-state", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2014-10-06 09:23:50" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", + "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-01-24 09:48:32" + }, + { + "name": "sebastian/version", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", + "reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2015-02-24 06:35:25" + }, + { + "name": "symfony/yaml", + "version": "v2.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/Yaml.git", + "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/4a29a5248aed4fb45f626a7bbbd330291492f5c3", + "reference": "4a29a5248aed4fb45f626a7bbbd330291492f5c3", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "time": "2015-05-02 15:21:08" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/vendor/phpdocumentor/reflection-common/phpunit.xml.dist b/vendor/phpdocumentor/reflection-common/phpunit.xml.dist new file mode 100644 index 00000000..31811501 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/phpunit.xml.dist @@ -0,0 +1,26 @@ + + + + + + ./tests/unit/ + + + + + src + + + + + + + + diff --git a/vendor/phpdocumentor/reflection-common/src/Element.php b/vendor/phpdocumentor/reflection-common/src/Element.php new file mode 100644 index 00000000..712e30e8 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/src/Element.php @@ -0,0 +1,32 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +/** + * Interface for files processed by the ProjectFactory + */ +interface File +{ + /** + * Returns the content of the file as a string. + * + * @return string + */ + public function getContents(); + + /** + * Returns md5 hash of the file. + * + * @return string + */ + public function md5(); + + /** + * Returns an relative path to the file. + * + * @return string + */ + public function path(); +} diff --git a/vendor/phpdocumentor/reflection-common/src/Fqsen.php b/vendor/phpdocumentor/reflection-common/src/Fqsen.php new file mode 100644 index 00000000..c7be3f15 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/src/Fqsen.php @@ -0,0 +1,78 @@ +fqsen = $fqsen; + + if (isset($matches[2])) { + $this->name = $matches[2]; + } else { + $matches = explode('\\', $fqsen); + $this->name = trim(end($matches), '()'); + } + } + + /** + * converts this class to string. + * + * @return string + */ + public function __toString() + { + return $this->fqsen; + } + + /** + * Returns the name of the element without path. + * + * @return string + */ + public function getName() + { + return $this->name; + } +} diff --git a/vendor/phpdocumentor/reflection-common/src/Location.php b/vendor/phpdocumentor/reflection-common/src/Location.php new file mode 100644 index 00000000..57603219 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/src/Location.php @@ -0,0 +1,57 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +/** + * The location where an element occurs within a file. + */ +final class Location +{ + /** @var int */ + private $lineNumber = 0; + + /** @var int */ + private $columnNumber = 0; + + /** + * Initializes the location for an element using its line number in the file and optionally the column number. + * + * @param int $lineNumber + * @param int $columnNumber + */ + public function __construct($lineNumber, $columnNumber = 0) + { + $this->lineNumber = $lineNumber; + $this->columnNumber = $columnNumber; + } + + /** + * Returns the line number that is covered by this location. + * + * @return integer + */ + public function getLineNumber() + { + return $this->lineNumber; + } + + /** + * Returns the column number (character position on a line) for this location object. + * + * @return integer + */ + public function getColumnNumber() + { + return $this->columnNumber; + } +} diff --git a/vendor/phpdocumentor/reflection-common/src/Project.php b/vendor/phpdocumentor/reflection-common/src/Project.php new file mode 100644 index 00000000..3ed1e393 --- /dev/null +++ b/vendor/phpdocumentor/reflection-common/src/Project.php @@ -0,0 +1,25 @@ +assertEquals($name, $instance->getName()); + } + + /** + * Data provider for ValidFormats tests. Contains a complete list from psr-5 draft. + * + * @return array + */ + public function validFqsenProvider() + { + return [ + ['\\', ''], + ['\My\Space', 'Space'], + ['\My\Space\myFunction()', 'myFunction'], + ['\My\Space\MY_CONSTANT', 'MY_CONSTANT'], + ['\My\Space\MY_CONSTANT2', 'MY_CONSTANT2'], + ['\My\Space\MyClass', 'MyClass'], + ['\My\Space\MyInterface', 'MyInterface'], + ['\My\Space\MyTrait', 'MyTrait'], + ['\My\Space\MyClass::myMethod()', 'myMethod'], + ['\My\Space\MyClass::$my_property', 'my_property'], + ['\My\Space\MyClass::MY_CONSTANT', 'MY_CONSTANT'], + ]; + } + + /** + * @param string $fqsen + * @covers ::__construct + * @dataProvider invalidFqsenProvider + * @expectedException \InvalidArgumentException + */ + public function testInValidFormats($fqsen) + { + new Fqsen($fqsen); + } + + /** + * Data provider for invalidFormats tests. Contains a complete list from psr-5 draft. + * + * @return array + */ + public function invalidFqsenProvider() + { + return [ + ['\My\*'], + ['\My\Space\.()'], + ['My\Space'], + ]; + } + + /** + * @covers ::__construct + * @covers ::__toString + */ + public function testToString() + { + $className = new Fqsen('\\phpDocumentor\\Application'); + + $this->assertEquals('\\phpDocumentor\\Application', (string)$className); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/.scrutinizer.yml b/vendor/phpdocumentor/reflection-docblock/.scrutinizer.yml new file mode 100644 index 00000000..5061d523 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/.scrutinizer.yml @@ -0,0 +1,32 @@ +before_commands: + - "composer install --no-dev --prefer-source" + +tools: + external_code_coverage: true + php_code_sniffer: + enabled: true + config: + standard: PSR2 + filter: + paths: ["src/*", "tests/*"] + php_cpd: + enabled: true + excluded_dirs: ["tests", "vendor"] + php_loc: + enabled: true + excluded_dirs: ["tests", "vendor"] + php_mess_detector: + enabled: true + config: + ruleset: phpmd.xml.dist + design_rules: { eval_expression: false } + filter: + paths: ["src/*"] + php_pdepend: + enabled: true + excluded_dirs: ["tests", "vendor"] + php_analyzer: + enabled: true + filter: + paths: ["src/*", "tests/*"] + sensiolabs_security_checker: true diff --git a/vendor/phpdocumentor/reflection-docblock/.travis.yml b/vendor/phpdocumentor/reflection-docblock/.travis.yml index eef782c4..920958df 100644 --- a/vendor/phpdocumentor/reflection-docblock/.travis.yml +++ b/vendor/phpdocumentor/reflection-docblock/.travis.yml @@ -1,28 +1,32 @@ language: php php: - - 5.3.3 - - 5.3 - - 5.4 - 5.5 - 5.6 + - 7.0 - hhvm - - hhvm-nightly + - nightly matrix: - allow_failures: - - php: hhvm - - php: hhvm-nightly + allow_failures: + - php: + - hhvm + - nightly + +cache: + directories: + - $HOME/.composer/cache script: - - vendor/bin/phpunit + - vendor/bin/phpunit --coverage-clover=coverage.clover -v + - composer update --no-interaction --prefer-source + - vendor/bin/phpunit -v before_script: - - sudo apt-get -qq update > /dev/null - - phpenv rehash > /dev/null - - composer selfupdate --quiet - - composer install --no-interaction --prefer-source --dev - - vendor/bin/phpunit - - composer update --no-interaction --prefer-source --dev + - composer install --no-interaction + +after_script: + - wget https://scrutinizer-ci.com/ocular.phar + - php ocular.phar code-coverage:upload --format=php-clover coverage.clover notifications: irc: "irc.freenode.org#phpdocumentor" diff --git a/vendor/phpdocumentor/reflection-docblock/README.md b/vendor/phpdocumentor/reflection-docblock/README.md index 6405d1a1..a1984a15 100644 --- a/vendor/phpdocumentor/reflection-docblock/README.md +++ b/vendor/phpdocumentor/reflection-docblock/README.md @@ -24,34 +24,46 @@ You can install the component in the following ways: Usage ----- -The ReflectionDocBlock component is designed to work in an identical fashion to -PHP's own Reflection extension (http://php.net/manual/en/book.reflection.php). - -Parsing can be initiated by instantiating the -`\phpDocumentor\Reflection\DocBlock()` class and passing it a string containing -a DocBlock (including asterisks) or by passing an object supporting the -`getDocComment()` method. - -> *Examples of objects having the `getDocComment()` method are the -> `ReflectionClass` and the `ReflectionMethod` classes of the PHP -> Reflection extension* - -Example: - - $class = new ReflectionClass('MyClass'); - $phpdoc = new \phpDocumentor\Reflection\DocBlock($class); - -or - - $docblock = <<create($docComment); +``` + +The `create` method will yield an object of type `\phpDocumentor\Reflection\DocBlock` +whose methods can be queried as shown in the following example. + +```php +// Should contain the summary for this DocBlock +$summary = $docblock->getSummary(); + +// Contains an object of type \phpDocumentor\Reflection\DocBlock\Description; +// you can either cast it to string or use the render method to get a string +// representation of the Description. +$description = $docblock->getDescription(); +``` + +> For more examples it would be best to review the scripts in the `/examples` +> folder. diff --git a/vendor/phpdocumentor/reflection-docblock/composer.json b/vendor/phpdocumentor/reflection-docblock/composer.json index 4dffa22d..85be2fdd 100644 --- a/vendor/phpdocumentor/reflection-docblock/composer.json +++ b/vendor/phpdocumentor/reflection-docblock/composer.json @@ -1,26 +1,28 @@ { "name": "phpdocumentor/reflection-docblock", + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "type": "library", "license": "MIT", "authors": [ - {"name": "Mike van Riel", "email": "mike.vanriel@naenius.com"} + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } ], "require": { - "php": ">=5.3.3" + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.2.0", + "webmozart/assert": "^1.0" }, "autoload": { - "psr-0": {"phpDocumentor": ["src/"]} - }, - "require-dev": { - "phpunit/phpunit": "~4.0" + "psr-4": {"phpDocumentor\\Reflection\\": ["src/"]} }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" + "autoload-dev": { + "psr-4": {"phpDocumentor\\Reflection\\": ["tests/unit"]} }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" } } diff --git a/vendor/phpdocumentor/reflection-docblock/composer.lock b/vendor/phpdocumentor/reflection-docblock/composer.lock index 4c6a8bb7..b4da3c1b 100644 --- a/vendor/phpdocumentor/reflection-docblock/composer.lock +++ b/vendor/phpdocumentor/reflection-docblock/composer.lock @@ -1,46 +1,194 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "ea1734d11b8c878445c2c6e58de8b85f", - "packages": [], + "hash": "9dfabded4193c3fd2ec85874de3b2e3c", + "content-hash": "69f6ae6608b8524fa04ddb0264bbf091", + "packages": [ + { + "name": "phpdocumentor/reflection-common", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "9969bd1c9661a73fdab104df7dbf132639d5c4d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/9969bd1c9661a73fdab104df7dbf132639d5c4d8", + "reference": "9969bd1c9661a73fdab104df7dbf132639d5c4d8", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2015-06-12 22:21:38" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/b39c7a5b194f9ed7bd0dd345c751007a41862443", + "reference": "b39c7a5b194f9ed7bd0dd345c751007a41862443", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2016-06-10 07:14:17" + }, + { + "name": "webmozart/assert", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "b8ef76d0f0c3b9a0a1bc987085fe0a0ddba984ab" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/b8ef76d0f0c3b9a0a1bc987085fe0a0ddba984ab", + "reference": "b8ef76d0f0c3b9a0a1bc987085fe0a0ddba984ab", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2015-05-12 15:19:25" + } + ], "packages-dev": [ { - "name": "ocramius/instantiator", - "version": "1.1.2", + "name": "doctrine/instantiator", + "version": "1.0.5", "source": { "type": "git", - "url": "https://github.com/Ocramius/Instantiator.git", - "reference": "a7abbb5fc9df6e7126af741dd6c140d1a7369435" + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/Instantiator/zipball/a7abbb5fc9df6e7126af741dd6c140d1a7369435", - "reference": "a7abbb5fc9df6e7126af741dd6c140d1a7369435", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", "shasum": "" }, "require": { - "ocramius/lazy-map": "1.0.*", - "php": "~5.3" + "php": ">=5.3,<8.0-DEV" }, "require-dev": { "athletic/athletic": "~0.1.8", "ext-pdo": "*", "ext-phar": "*", "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "2.0.*@ALPHA" + "squizlabs/php_codesniffer": "~2.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "1.0.x-dev" } }, "autoload": { - "psr-0": { - "Instantiator\\": "src" + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" } }, "notification-url": "https://packagist.org/downloads/", @@ -55,96 +203,148 @@ } ], "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/Ocramius/Instantiator", + "homepage": "https://github.com/doctrine/instantiator", "keywords": [ "constructor", "instantiate" ], - "time": "2014-08-14 15:10:55" + "time": "2015-06-14 21:17:01" }, { - "name": "ocramius/lazy-map", - "version": "1.0.0", + "name": "hamcrest/hamcrest-php", + "version": "v1.2.2", "source": { "type": "git", - "url": "https://github.com/Ocramius/LazyMap.git", - "reference": "7fe3d347f5e618bcea7d39345ff83f3651d8b752" + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Ocramius/LazyMap/zipball/7fe3d347f5e618bcea7d39345ff83f3651d8b752", - "reference": "7fe3d347f5e618bcea7d39345ff83f3651d8b752", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/b37020aa976fa52d3de9aa904aa2522dc518f79c", + "reference": "b37020aa976fa52d3de9aa904aa2522dc518f79c", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.2" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" }, "require-dev": { - "athletic/athletic": "~0.1.6", - "phpmd/phpmd": "1.5.*", - "phpunit/phpunit": ">=3.7", - "satooshi/php-coveralls": "~0.6", - "squizlabs/php_codesniffer": "1.4.*" + "phpunit/php-file-iterator": "1.3.3", + "satooshi/php-coveralls": "dev-master" + }, + "type": "library", + "autoload": { + "classmap": [ + "hamcrest" + ], + "files": [ + "hamcrest/Hamcrest.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" + ], + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2015-05-11 14:41:42" + }, + { + "name": "mockery/mockery", + "version": "0.9.4", + "source": { + "type": "git", + "url": "https://github.com/padraic/mockery.git", + "reference": "70bba85e4aabc9449626651f48b9018ede04f86b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/padraic/mockery/zipball/70bba85e4aabc9449626651f48b9018ede04f86b", + "reference": "70bba85e4aabc9449626651f48b9018ede04f86b", + "shasum": "" + }, + "require": { + "hamcrest/hamcrest-php": "~1.1", + "lib-pcre": ">=7.0", + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "0.9.x-dev" } }, "autoload": { "psr-0": { - "LazyMap\\": "src" + "Mockery": "library/" } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/", - "role": "Developer" + "name": "Pádraic Brady", + "email": "padraic.brady@gmail.com", + "homepage": "http://blog.astrumfutura.com" + }, + { + "name": "Dave Marshall", + "email": "dave.marshall@atstsolutions.co.uk", + "homepage": "http://davedevelopment.co.uk" } ], - "description": "A library that provides lazy instantiation logic for a map of objects", - "homepage": "https://github.com/Ocramius/LazyMap", + "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", + "homepage": "http://github.com/padraic/mockery", "keywords": [ - "lazy", - "lazy instantiation", - "lazy loading", - "map", - "service location" + "BDD", + "TDD", + "library", + "mock", + "mock objects", + "mockery", + "stub", + "test", + "test double", + "testing" ], - "time": "2013-11-09 22:30:54" + "time": "2015-04-02 19:54:00" }, { "name": "phpunit/php-code-coverage", - "version": "2.0.10", + "version": "2.1.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "6d196af48e8c100a3ae881940123e693da5a9217" + "reference": "631e365cf26bb2c078683e8d9bcf8bc631ac4d44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6d196af48e8c100a3ae881940123e693da5a9217", - "reference": "6d196af48e8c100a3ae881940123e693da5a9217", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/631e365cf26bb2c078683e8d9bcf8bc631ac4d44", + "reference": "631e365cf26bb2c078683e8d9bcf8bc631ac4d44", "shasum": "" }, "require": { "php": ">=5.3.3", - "phpunit/php-file-iterator": "~1.3.1", - "phpunit/php-text-template": "~1.2.0", - "phpunit/php-token-stream": "~1.2.2", - "sebastian/environment": "~1.0.0", - "sebastian/version": "~1.0.3" + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "~1.0", + "sebastian/version": "~1.0" }, "require-dev": { "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4.0.14" + "phpunit/phpunit": "~4" }, "suggest": { "ext-dom": "*", @@ -154,7 +354,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.1.x-dev" } }, "autoload": { @@ -163,9 +363,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -183,7 +380,7 @@ "testing", "xunit" ], - "time": "2014-08-06 06:39:42" + "time": "2015-06-19 07:11:55" }, { "name": "phpunit/php-file-iterator", @@ -232,16 +429,16 @@ }, { "name": "phpunit/php-text-template", - "version": "1.2.0", + "version": "1.2.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", - "reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", "shasum": "" }, "require": { @@ -250,20 +447,17 @@ "type": "library", "autoload": { "classmap": [ - "Text/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -272,20 +466,20 @@ "keywords": [ "template" ], - "time": "2014-01-30 17:20:04" + "time": "2015-06-21 13:50:34" }, { "name": "phpunit/php-timer", - "version": "1.0.5", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c" + "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/19689d4354b295ee3d8c54b4f42c3efb69cbc17c", - "reference": "19689d4354b295ee3d8c54b4f42c3efb69cbc17c", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/83fe1bdc5d47658b727595c14da140da92b3d66d", + "reference": "83fe1bdc5d47658b727595c14da140da92b3d66d", "shasum": "" }, "require": { @@ -294,13 +488,10 @@ "type": "library", "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -316,49 +507,48 @@ "keywords": [ "timer" ], - "time": "2013-08-02 07:42:54" + "time": "2015-06-13 07:35:30" }, { "name": "phpunit/php-token-stream", - "version": "1.2.2", + "version": "1.4.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32" + "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/ad4e1e23ae01b483c16f600ff1bebec184588e32", - "reference": "ad4e1e23ae01b483c16f600ff1bebec184588e32", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9", + "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9", "shasum": "" }, "require": { "ext-tokenizer": "*", "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev" + "dev-master": "1.4-dev" } }, "autoload": { "classmap": [ - "PHP/" + "src/" ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], "description": "Wrapper around PHP's tokenizer extension.", @@ -366,20 +556,20 @@ "keywords": [ "tokenizer" ], - "time": "2014-03-03 05:10:30" + "time": "2015-06-19 03:43:16" }, { "name": "phpunit/phpunit", - "version": "4.2.2", + "version": "4.4.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "a33fa68ece9f8c68589bfc2da8d2794e27b820bc" + "reference": "2e8580deebb7d1ac92ac878595e6bffe01069c2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a33fa68ece9f8c68589bfc2da8d2794e27b820bc", - "reference": "a33fa68ece9f8c68589bfc2da8d2794e27b820bc", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/2e8580deebb7d1ac92ac878595e6bffe01069c2a", + "reference": "2e8580deebb7d1ac92ac878595e6bffe01069c2a", "shasum": "" }, "require": { @@ -390,14 +580,16 @@ "ext-spl": "*", "php": ">=5.3.3", "phpunit/php-code-coverage": "~2.0", - "phpunit/php-file-iterator": "~1.3.1", + "phpunit/php-file-iterator": "~1.3.2", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "~1.0.2", - "phpunit/phpunit-mock-objects": "~2.2", + "phpunit/phpunit-mock-objects": "~2.3", "sebastian/comparator": "~1.0", "sebastian/diff": "~1.1", - "sebastian/environment": "~1.0", - "sebastian/exporter": "~1.0", + "sebastian/environment": "~1.1", + "sebastian/exporter": "~1.1", + "sebastian/global-state": "~1.0", + "sebastian/recursion-context": "~1.0", "sebastian/version": "~1.0", "symfony/yaml": "~2.0" }, @@ -410,7 +602,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.2.x-dev" + "dev-master": "4.4.x-dev" } }, "autoload": { @@ -419,10 +611,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "", - "../../symfony/yaml/" - ], "license": [ "BSD-3-Clause" ], @@ -434,35 +622,35 @@ } ], "description": "The PHP Unit Testing framework.", - "homepage": "http://www.phpunit.de/", + "homepage": "https://phpunit.de/", "keywords": [ "phpunit", "testing", "xunit" ], - "time": "2014-08-18 05:12:30" + "time": "2015-01-27 16:06:15" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.2.0", + "version": "2.3.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "42e589e08bc86e3e9bdf20d385e948347788505b" + "reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/42e589e08bc86e3e9bdf20d385e948347788505b", - "reference": "42e589e08bc86e3e9bdf20d385e948347788505b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/92408bb1968a81b3217a6fdf6c1a198da83caa35", + "reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35", "shasum": "" }, "require": { - "ocramius/instantiator": "~1.0", + "doctrine/instantiator": "~1.0,>=1.0.2", "php": ">=5.3.3", "phpunit/php-text-template": "~1.2" }, "require-dev": { - "phpunit/phpunit": "4.2.*@dev" + "phpunit/phpunit": "~4.4" }, "suggest": { "ext-soap": "*" @@ -470,7 +658,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "2.3.x-dev" } }, "autoload": { @@ -479,9 +667,6 @@ ] }, "notification-url": "https://packagist.org/downloads/", - "include-path": [ - "" - ], "license": [ "BSD-3-Clause" ], @@ -498,34 +683,34 @@ "mock", "xunit" ], - "time": "2014-08-02 13:50:58" + "time": "2015-06-11 15:55:48" }, { "name": "sebastian/comparator", - "version": "1.0.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2" + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", - "reference": "f7069ee51fa9fb6c038e16a9d0e3439f5449dcf2", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dd8869519a225f7f2b9eb663e225298fade819e", + "reference": "1dd8869519a225f7f2b9eb663e225298fade819e", "shasum": "" }, "require": { "php": ">=5.3.3", - "sebastian/diff": "~1.1", - "sebastian/exporter": "~1.0" + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2" }, "require-dev": { - "phpunit/phpunit": "~4.1" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -538,11 +723,6 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -554,6 +734,10 @@ { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], "description": "Provides the functionality to compare PHP values for equality", @@ -563,29 +747,32 @@ "compare", "equality" ], - "time": "2014-05-02 07:05:58" + "time": "2015-01-29 16:28:08" }, { "name": "sebastian/diff", - "version": "1.1.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d" + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", - "reference": "1e091702a5a38e6b4c1ba9ca816e3dd343df2e2d", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", + "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", "shasum": "" }, "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1-dev" + "dev-master": "1.3-dev" } }, "autoload": { @@ -598,14 +785,13 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, { "name": "Kore Nordmann", "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], "description": "Diff implementation", @@ -613,32 +799,32 @@ "keywords": [ "diff" ], - "time": "2013-08-03 16:46:33" + "time": "2015-02-22 15:13:53" }, { "name": "sebastian/environment", - "version": "1.0.0", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a" + "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/79517609ec01139cd7e9fded0dd7ce08c952ef6a", - "reference": "79517609ec01139cd7e9fded0dd7ce08c952ef6a", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5a8c7d31914337b69923db26c4221b81ff5a196e", + "reference": "5a8c7d31914337b69923db26c4221b81ff5a196e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "4.0.*@dev" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -653,8 +839,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" + "email": "sebastian@phpunit.de" } ], "description": "Provides functionality to handle HHVM/PHP environments", @@ -664,32 +849,33 @@ "environment", "hhvm" ], - "time": "2014-02-18 16:17:19" + "time": "2015-01-01 10:01:08" }, { "name": "sebastian/exporter", - "version": "1.0.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529" + "reference": "84839970d05254c73cde183a721c7af13aede943" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", - "reference": "1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/84839970d05254c73cde183a721c7af13aede943", + "reference": "84839970d05254c73cde183a721c7af13aede943", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" }, "require-dev": { - "phpunit/phpunit": "4.0.*@dev" + "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -702,11 +888,6 @@ "BSD-3-Clause" ], "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - }, { "name": "Jeff Welch", "email": "whatthejeff@gmail.com" @@ -715,14 +896,17 @@ "name": "Volker Dusch", "email": "github@wallbash.com" }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net", - "role": "Lead" - }, { "name": "Bernhard Schussek", "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], "description": "Provides the functionality to export PHP variables for visualization", @@ -731,20 +915,124 @@ "export", "exporter" ], - "time": "2014-02-16 08:26:31" + "time": "2015-01-27 07:23:06" + }, + { + "name": "sebastian/global-state", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "reference": "c7428acdb62ece0a45e6306f1ae85e1c05b09c01", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2014-10-06 09:23:50" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "3989662bbb30a29d20d9faa04a846af79b276252" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/3989662bbb30a29d20d9faa04a846af79b276252", + "reference": "3989662bbb30a29d20d9faa04a846af79b276252", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2015-01-24 09:48:32" }, { "name": "sebastian/version", - "version": "1.0.3", + "version": "1.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43" + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", - "reference": "b6e1f0cf6b9e1ec409a0d3e2f2a5fb0998e36b43", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", "shasum": "" }, "type": "library", @@ -766,34 +1054,36 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2014-03-07 15:35:33" + "time": "2015-06-21 13:59:46" }, { "name": "symfony/yaml", - "version": "v2.5.3", - "target-dir": "Symfony/Component/Yaml", + "version": "v2.7.1", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", - "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f" + "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", - "reference": "5a75366ae9ca8b4792cd0083e4ca4dff9fe96f1f", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/9808e75c609a14f6db02f70fccf4ca4aab53c160", + "reference": "9808e75c609a14f6db02f70fccf4ca4aab53c160", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=5.3.9" + }, + "require-dev": { + "symfony/phpunit-bridge": "~2.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.5-dev" + "dev-master": "2.7-dev" } }, "autoload": { - "psr-0": { + "psr-4": { "Symfony\\Component\\Yaml\\": "" } }, @@ -802,26 +1092,29 @@ "MIT" ], "authors": [ - { - "name": "Symfony Community", - "homepage": "http://symfony.com/contributors" - }, { "name": "Fabien Potencier", "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" } ], "description": "Symfony Yaml Component", - "homepage": "http://symfony.com", - "time": "2014-08-05 09:00:40" + "homepage": "https://symfony.com", + "time": "2015-06-10 15:30:22" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "phpdocumentor/reflection-common": 20 + }, "prefer-stable": false, + "prefer-lowest": false, "platform": { - "php": ">=5.3.3" + "php": ">=5.5" }, "platform-dev": [] } diff --git a/vendor/phpdocumentor/reflection-docblock/examples/01-interpreting-a-simple-docblock.php b/vendor/phpdocumentor/reflection-docblock/examples/01-interpreting-a-simple-docblock.php new file mode 100644 index 00000000..6d67dea4 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/examples/01-interpreting-a-simple-docblock.php @@ -0,0 +1,27 @@ +create($docComment); + +// Should contain the first line of the DocBlock +$summary = $docblock->getSummary(); + +// Contains an object of type Description; you can either cast it to string or use +// the render method to get a string representation of the Description. +// +// In subsequent examples we will be fiddling a bit more with the Description. +$description = $docblock->getDescription(); diff --git a/vendor/phpdocumentor/reflection-docblock/examples/02-interpreting-tags.php b/vendor/phpdocumentor/reflection-docblock/examples/02-interpreting-tags.php new file mode 100644 index 00000000..23995889 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/examples/02-interpreting-tags.php @@ -0,0 +1,24 @@ +create($docComment); + +// You can check if a DocBlock has one or more see tags +$hasSeeTag = $docblock->hasTag('see'); + +// Or we can get a complete list of all tags +$tags = $docblock->getTags(); + +// But we can also grab all tags of a specific type, such as `see` +$seeTags = $docblock->getTagsByName('see'); diff --git a/vendor/phpdocumentor/reflection-docblock/examples/03-reconstituting-a-docblock.php b/vendor/phpdocumentor/reflection-docblock/examples/03-reconstituting-a-docblock.php new file mode 100644 index 00000000..6bc10baf --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/examples/03-reconstituting-a-docblock.php @@ -0,0 +1,27 @@ +create($docComment); + +// Create the serializer that will reconstitute the DocBlock back to its original form. +$serializer = new Serializer(); + +// Reconstitution is performed by the `getDocComment()` method. +$reconstitutedDocComment = $serializer->getDocComment($docblock); + diff --git a/vendor/phpdocumentor/reflection-docblock/examples/04-adding-your-own-tag.php b/vendor/phpdocumentor/reflection-docblock/examples/04-adding-your-own-tag.php new file mode 100644 index 00000000..026d6069 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/examples/04-adding-your-own-tag.php @@ -0,0 +1,135 @@ + Important: Tag classes that act as Factories using the `create` method should implement the TagFactory interface. + */ +final class MyTag extends BaseTag implements StaticMethod +{ + /** + * A required property that is used by Formatters to reconstitute the complete tag line. + * + * @see Formatter + * + * @var string + */ + protected $name = 'my-tag'; + + /** + * The constructor for this Tag; this should contain all properties for this object. + * + * @param Description $description An example of how to add a Description to the tag; the Description is often + * an optional variable so passing null is allowed in this instance (though you can + * also construct an empty description object). + * + * @see BaseTag for the declaration of the description property and getDescription method. + */ + public function __construct(Description $description = null) + { + $this->description = $description; + } + + /** + * A static Factory that creates a new instance of the current Tag. + * + * In this example the MyTag tag can be created by passing a description text as $body. Because we have added + * a $descriptionFactory that is type-hinted as DescriptionFactory we can now construct a new Description object + * and pass that to the constructor. + * + * > You could directly instantiate a Description object here but that won't be parsed for inline tags and Types + * > won't be resolved. The DescriptionFactory will take care of those actions. + * + * The `create` method's interface states that this method only features a single parameter (`$body`) but the + * {@see TagFactory} will read the signature of this method and if it has more parameters then it will try + * to find declarations for it in the ServiceLocator of the TagFactory (see {@see TagFactory::$serviceLocator}). + * + * > Important: all properties following the `$body` should default to `null`, otherwise PHP will error because + * > it no longer matches the interface. This is why you often see the default tags check that an optional argument + * > is not null nonetheless. + * + * @param string $body + * @param DescriptionFactory $descriptionFactory + * @param Context|null $context The Context is used to resolve Types and FQSENs, although optional + * it is highly recommended to pass it. If you omit it then it is assumed that + * the DocBlock is in the global namespace and has no `use` statements. + * + * @see Tag for the interface declaration of the `create` method. + * @see Tag::create() for more information on this method's workings. + * + * @return MyTag + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, Context $context = null) + { + Assert::string($body); + Assert::notNull($descriptionFactory); + + return new static($descriptionFactory->create($body, $context)); + } + + /** + * Returns a rendition of the original tag line. + * + * This method is used to reconstitute a DocBlock into its original form by the {@see Serializer}. It should + * feature all parts of the tag so that the serializer can put it back together. + * + * @return string + */ + public function __toString() + { + return (string)$this->description; + } +} + +$docComment = << MyTag::class]; + +// Do pass the list of custom tags to the Factory for the DocBlockFactory. +$factory = DocBlockFactory::createInstance($customTags); +// You can also add Tags later using `$factory->registerTagHandler()` with a tag name and Tag class name. + +// Create the DocBlock +$docblock = $factory->create($docComment); + +// Take a look: the $customTagObjects now contain an array with your newly added tag +$customTagObjects = $docblock->getTagsByName('my-tag'); + +// As an experiment: let's reconstitute the DocBlock and observe that because we added a __toString() method +// to the tag class that we can now also see it. +$serializer = new Serializer(); +$reconstitutedDocComment = $serializer->getDocComment($docblock); diff --git a/vendor/phpdocumentor/reflection-docblock/examples/playing-with-descriptions/02-escaping.php b/vendor/phpdocumentor/reflection-docblock/examples/playing-with-descriptions/02-escaping.php new file mode 100644 index 00000000..5ec772fe --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/examples/playing-with-descriptions/02-escaping.php @@ -0,0 +1,47 @@ +create($docComment); + +// Escaping is automatic so this happens in the DescriptionFactory. +$description = $docblock->getDescription(); + +// This is the rendition that we will receive of the Description. +$receivedDocComment = <<render(); diff --git a/vendor/phpdocumentor/reflection-docblock/phpmd.xml.dist b/vendor/phpdocumentor/reflection-docblock/phpmd.xml.dist new file mode 100644 index 00000000..9abf85cf --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/phpmd.xml.dist @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + 40 + + + diff --git a/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist b/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist index f67ad2a2..3c2e9a37 100644 --- a/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist +++ b/vendor/phpdocumentor/reflection-docblock/phpunit.xml.dist @@ -1,14 +1,33 @@ - + - - ./tests/ + + ./tests/unit + + ./tests/integration + ./src/ + + ./vendor/ + + + + diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php new file mode 100644 index 00000000..39911406 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock.php @@ -0,0 +1,220 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\DocBlock\Tag; +use Webmozart\Assert\Assert; + +final class DocBlock +{ + /** @var string The opening line for this docblock. */ + private $summary = ''; + + /** @var DocBlock\Description The actual description for this docblock. */ + private $description = null; + + /** @var Tag[] An array containing all the tags in this docblock; except inline. */ + private $tags = array(); + + /** @var Types\Context Information about the context of this DocBlock. */ + private $context = null; + + /** @var Location Information about the location of this DocBlock. */ + private $location = null; + + /** @var bool Is this DocBlock (the start of) a template? */ + private $isTemplateStart = false; + + /** @var bool Does this DocBlock signify the end of a DocBlock template? */ + private $isTemplateEnd = false; + + /** + * @param string $summary + * @param DocBlock\Description $description + * @param DocBlock\Tag[] $tags + * @param Types\Context $context The context in which the DocBlock occurs. + * @param Location $location The location within the file that this DocBlock occurs in. + * @param bool $isTemplateStart + * @param bool $isTemplateEnd + */ + public function __construct( + $summary = '', + DocBlock\Description $description = null, + array $tags = [], + Types\Context $context = null, + Location $location = null, + $isTemplateStart = false, + $isTemplateEnd = false + ) + { + Assert::string($summary); + Assert::boolean($isTemplateStart); + Assert::boolean($isTemplateEnd); + Assert::allIsInstanceOf($tags, Tag::class); + + $this->summary = $summary; + $this->description = $description ?: new DocBlock\Description(''); + foreach ($tags as $tag) { + $this->addTag($tag); + } + + $this->context = $context; + $this->location = $location; + + $this->isTemplateEnd = $isTemplateEnd; + $this->isTemplateStart = $isTemplateStart; + } + + /** + * @return string + */ + public function getSummary() + { + return $this->summary; + } + + /** + * @return DocBlock\Description + */ + public function getDescription() + { + return $this->description; + } + + /** + * Returns the current context. + * + * @return Types\Context + */ + public function getContext() + { + return $this->context; + } + + /** + * Returns the current location. + * + * @return Location + */ + public function getLocation() + { + return $this->location; + } + + /** + * Returns whether this DocBlock is the start of a Template section. + * + * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker + * (`#@+`) that is appended directly after the opening `/**` of a DocBlock. + * + * An example of such an opening is: + * + * ``` + * /**#@+ + * * My DocBlock + * * / + * ``` + * + * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all + * elements that follow until another DocBlock is found that contains the closing marker (`#@-`). + * + * @see self::isTemplateEnd() for the check whether a closing marker was provided. + * + * @return boolean + */ + public function isTemplateStart() + { + return $this->isTemplateStart; + } + + /** + * Returns whether this DocBlock is the end of a Template section. + * + * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. + * + * @return boolean + */ + public function isTemplateEnd() + { + return $this->isTemplateEnd; + } + + /** + * Returns the tags for this DocBlock. + * + * @return Tag[] + */ + public function getTags() + { + return $this->tags; + } + + /** + * Returns an array of tags matching the given name. If no tags are found + * an empty array is returned. + * + * @param string $name String to search by. + * + * @return Tag[] + */ + public function getTagsByName($name) + { + Assert::string($name); + + $result = array(); + + /** @var Tag $tag */ + foreach ($this->getTags() as $tag) { + if ($tag->getName() != $name) { + continue; + } + + $result[] = $tag; + } + + return $result; + } + + /** + * Checks if a tag of a certain type is present in this DocBlock. + * + * @param string $name Tag name to check for. + * + * @return bool + */ + public function hasTag($name) + { + Assert::string($name); + + /** @var Tag $tag */ + foreach ($this->getTags() as $tag) { + if ($tag->getName() == $name) { + return true; + } + } + + return false; + } + + /** + * Adds a tag to this DocBlock. + * + * @param Tag $tag The tag to add. + * + * @return void + */ + private function addTag(Tag $tag) + { + $this->tags[] = $tag; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php new file mode 100644 index 00000000..d1d7fc64 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Description.php @@ -0,0 +1,103 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock\Tags\Formatter; +use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter; +use Webmozart\Assert\Assert; + +/** + * Object representing to description for a DocBlock. + * + * A Description object can consist of plain text but can also include tags. A Description Formatter can then combine + * a body template with sprintf-style placeholders together with formatted tags in order to reconstitute a complete + * description text using the format that you would prefer. + * + * Because parsing a Description text can be a verbose process this is handled by the {@see DescriptionFactory}. It is + * thus recommended to use that to create a Description object, like this: + * + * $description = $descriptionFactory->create('This is a {@see Description}', $context); + * + * The description factory will interpret the given body and create a body template and list of tags from them, and pass + * that onto the constructor if this class. + * + * > The $context variable is a class of type {@see \phpDocumentor\Reflection\Types\Context} and contains the namespace + * > and the namespace aliases that apply to this DocBlock. These are used by the Factory to resolve and expand partial + * > type names and FQSENs. + * + * If you do not want to use the DescriptionFactory you can pass a body template and tag listing like this: + * + * $description = new Description( + * 'This is a %1$s', + * [ new See(new Fqsen('\phpDocumentor\Reflection\DocBlock\Description')) ] + * ); + * + * It is generally recommended to use the Factory as that will also apply escaping rules, while the Description object + * is mainly responsible for rendering. + * + * @see DescriptionFactory to create a new Description. + * @see Description\Formatter for the formatting of the body and tags. + */ +class Description +{ + /** @var string */ + private $bodyTemplate; + + /** @var Tag[] */ + private $tags; + + /** + * Initializes a Description with its body (template) and a listing of the tags used in the body template. + * + * @param string $bodyTemplate + * @param Tag[] $tags + */ + public function __construct($bodyTemplate, array $tags = []) + { + Assert::string($bodyTemplate); + + $this->bodyTemplate = $bodyTemplate; + $this->tags = $tags; + } + + /** + * Renders this description as a string where the provided formatter will format the tags in the expected string + * format. + * + * @param Formatter|null $formatter + * + * @return string + */ + public function render(Formatter $formatter = null) + { + if ($formatter === null) { + $formatter = new PassthroughFormatter(); + } + + $tags = []; + foreach ($this->tags as $tag) { + $tags[] = '{' . $formatter->format($tag) . '}'; + } + return vsprintf($this->bodyTemplate, $tags); + } + + /** + * Returns a plain string representation of this description. + * + * @return string + */ + public function __toString() + { + return $this->render(); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php new file mode 100644 index 00000000..d59858b7 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/DescriptionFactory.php @@ -0,0 +1,191 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\Types\Context as TypeContext; + +/** + * Creates a new Description object given a body of text. + * + * Descriptions in phpDocumentor are somewhat complex entities as they can contain one or more tags inside their + * body that can be replaced with a readable output. The replacing is done by passing a Formatter object to the + * Description object's `render` method. + * + * In addition to the above does a Description support two types of escape sequences: + * + * 1. `{@}` to escape the `@` character to prevent it from being interpreted as part of a tag, i.e. `{{@}link}` + * 2. `{}` to escape the `}` character, this can be used if you want to use the `}` character in the description + * of an inline tag. + * + * If a body consists of multiple lines then this factory will also remove any superfluous whitespace at the beginning + * of each line while maintaining any indentation that is used. This will prevent formatting parsers from tripping + * over unexpected spaces as can be observed with tag descriptions. + */ +class DescriptionFactory +{ + /** @var TagFactory */ + private $tagFactory; + + /** + * Initializes this factory with the means to construct (inline) tags. + * + * @param TagFactory $tagFactory + */ + public function __construct(TagFactory $tagFactory) + { + $this->tagFactory = $tagFactory; + } + + /** + * Returns the parsed text of this description. + * + * @param string $contents + * @param TypeContext $context + * + * @return Description + */ + public function create($contents, TypeContext $context = null) + { + list($text, $tags) = $this->parse($this->lex($contents), $context); + + return new Description($text, $tags); + } + + /** + * Strips the contents from superfluous whitespace and splits the description into a series of tokens. + * + * @param string $contents + * + * @return string[] A series of tokens of which the description text is composed. + */ + private function lex($contents) + { + $contents = $this->removeSuperfluousStartingWhitespace($contents); + + // performance optimalization; if there is no inline tag, don't bother splitting it up. + if (strpos($contents, '{@') === false) { + return [$contents]; + } + + return preg_split( + '/\{ + # "{@}" is not a valid inline tag. This ensures that we do not treat it as one, but treat it literally. + (?!@\}) + # We want to capture the whole tag line, but without the inline tag delimiters. + (\@ + # Match everything up to the next delimiter. + [^{}]* + # Nested inline tag content should not be captured, or it will appear in the result separately. + (?: + # Match nested inline tags. + (?: + # Because we did not catch the tag delimiters earlier, we must be explicit with them here. + # Notice that this also matches "{}", as a way to later introduce it as an escape sequence. + \{(?1)?\} + | + # Make sure we match hanging "{". + \{ + ) + # Match content after the nested inline tag. + [^{}]* + )* # If there are more inline tags, match them as well. We use "*" since there may not be any + # nested inline tags. + ) + \}/Sux', + $contents, + null, + PREG_SPLIT_DELIM_CAPTURE + ); + } + + /** + * Parses the stream of tokens in to a new set of tokens containing Tags. + * + * @param string[] $tokens + * @param TypeContext $context + * + * @return string[]|Tag[] + */ + private function parse($tokens, TypeContext $context) + { + $count = count($tokens); + $tagCount = 0; + $tags = []; + + for ($i = 1; $i < $count; $i += 2) { + $tags[] = $this->tagFactory->create($tokens[$i], $context); + $tokens[$i] = '%' . ++$tagCount . '$s'; + } + + //In order to allow "literal" inline tags, the otherwise invalid + //sequence "{@}" is changed to "@", and "{}" is changed to "}". + //See unit tests for examples. + for ($i = 0; $i < $count; $i += 2) { + $tokens[$i] = str_replace(['{@}', '{}'], ['@', '}'], $tokens[$i]); + } + + return [implode('', $tokens), $tags]; + } + + /** + * Removes the superfluous from a multi-line description. + * + * When a description has more than one line then it can happen that the second and subsequent lines have an + * additional indentation. This is commonly in use with tags like this: + * + * {@}since 1.1.0 This is an example + * description where we have an + * indentation in the second and + * subsequent lines. + * + * If we do not normalize the indentation then we have superfluous whitespace on the second and subsequent + * lines and this may cause rendering issues when, for example, using a Markdown converter. + * + * @param string $contents + * + * @return string + */ + private function removeSuperfluousStartingWhitespace($contents) + { + $lines = explode("\n", $contents); + + // if there is only one line then we don't have lines with superfluous whitespace and + // can use the contents as-is + if (count($lines) <= 1) { + return $contents; + } + + // determine how many whitespace characters need to be stripped + $startingSpaceCount = 9999999; + for ($i = 1; $i < count($lines); $i++) { + // lines with a no length do not count as they are not indented at all + if (strlen(trim($lines[$i])) === 0) { + continue; + } + + // determine the number of prefixing spaces by checking the difference in line length before and after + // an ltrim + $startingSpaceCount = min($startingSpaceCount, strlen($lines[$i]) - strlen(ltrim($lines[$i]))); + } + + // strip the number of spaces from each line + if ($startingSpaceCount > 0) { + for ($i = 1; $i < count($lines); $i++) { + $lines[$i] = substr($lines[$i], $startingSpaceCount); + } + } + + return implode("\n", $lines); + } + +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php new file mode 100644 index 00000000..3cc5dab3 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/ExampleFinder.php @@ -0,0 +1,170 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\DocBlock\Tags\Example; + +/** + * Class used to find an example file's location based on a given ExampleDescriptor. + */ +class ExampleFinder +{ + /** @var string */ + private $sourceDirectory = ''; + + /** @var string[] */ + private $exampleDirectories = array(); + + /** + * Attempts to find the example contents for the given descriptor. + * + * @param Example $example + * + * @return string + */ + public function find(Example $example) + { + $filename = $example->getFilePath(); + + $file = $this->getExampleFileContents($filename); + if (!$file) { + return "** File not found : {$filename} **"; + } + + return implode('', array_slice($file, $example->getStartingLine() - 1, $example->getLineCount())); + } + + /** + * Registers the project's root directory where an 'examples' folder can be expected. + * + * @param string $directory + * + * @return void + */ + public function setSourceDirectory($directory = '') + { + $this->sourceDirectory = $directory; + } + + /** + * Returns the project's root directory where an 'examples' folder can be expected. + * + * @return string + */ + public function getSourceDirectory() + { + return $this->sourceDirectory; + } + + /** + * Registers a series of directories that may contain examples. + * + * @param string[] $directories + */ + public function setExampleDirectories(array $directories) + { + $this->exampleDirectories = $directories; + } + + /** + * Returns a series of directories that may contain examples. + * + * @return string[] + */ + public function getExampleDirectories() + { + return $this->exampleDirectories; + } + + /** + * Attempts to find the requested example file and returns its contents or null if no file was found. + * + * This method will try several methods in search of the given example file, the first one it encounters is + * returned: + * + * 1. Iterates through all examples folders for the given filename + * 2. Checks the source folder for the given filename + * 3. Checks the 'examples' folder in the current working directory for examples + * 4. Checks the path relative to the current working directory for the given filename + * + * @param string $filename + * + * @return string|null + */ + private function getExampleFileContents($filename) + { + $normalizedPath = null; + + foreach ($this->exampleDirectories as $directory) { + $exampleFileFromConfig = $this->constructExamplePath($directory, $filename); + if (is_readable($exampleFileFromConfig)) { + $normalizedPath = $exampleFileFromConfig; + break; + } + } + + if (!$normalizedPath) { + if (is_readable($this->getExamplePathFromSource($filename))) { + $normalizedPath = $this->getExamplePathFromSource($filename); + } elseif (is_readable($this->getExamplePathFromExampleDirectory($filename))) { + $normalizedPath = $this->getExamplePathFromExampleDirectory($filename); + } elseif (is_readable($filename)) { + $normalizedPath = $filename; + } + } + + return $normalizedPath && is_readable($normalizedPath) ? file($normalizedPath) : null; + } + + /** + * Get example filepath based on the example directory inside your project. + * + * @param string $file + * + * @return string + */ + private function getExamplePathFromExampleDirectory($file) + { + return getcwd() . DIRECTORY_SEPARATOR . 'examples' . DIRECTORY_SEPARATOR . $file; + } + + /** + * Returns a path to the example file in the given directory.. + * + * @param string $directory + * @param string $file + * + * @return string + */ + private function constructExamplePath($directory, $file) + { + return rtrim($directory, '\\/') . DIRECTORY_SEPARATOR . $file; + } + + /** + * Get example filepath based on sourcecode. + * + * @param string $file + * + * @return string + */ + private function getExamplePathFromSource($file) + { + return sprintf( + '%s%s%s', + trim($this->getSourceDirectory(), '\\/'), + DIRECTORY_SEPARATOR, + trim($file, '"') + ); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php new file mode 100644 index 00000000..7f1c89d3 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Serializer.php @@ -0,0 +1,143 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock; +use Webmozart\Assert\Assert; + +/** + * Converts a DocBlock back from an object to a complete DocComment including Asterisks. + */ +class Serializer +{ + /** @var string The string to indent the comment with. */ + protected $indentString = ' '; + + /** @var int The number of times the indent string is repeated. */ + protected $indent = 0; + + /** @var bool Whether to indent the first line with the given indent amount and string. */ + protected $isFirstLineIndented = true; + + /** @var int|null The max length of a line. */ + protected $lineLength = null; + + /** + * Create a Serializer instance. + * + * @param int $indent The number of times the indent string is repeated. + * @param string $indentString The string to indent the comment with. + * @param bool $indentFirstLine Whether to indent the first line. + * @param int|null $lineLength The max length of a line or NULL to disable line wrapping. + */ + public function __construct($indent = 0, $indentString = ' ', $indentFirstLine = true, $lineLength = null) + { + Assert::integer($indent); + Assert::string($indentString); + Assert::boolean($indentFirstLine); + Assert::nullOrInteger($lineLength); + + $this->indent = $indent; + $this->indentString = $indentString; + $this->isFirstLineIndented = $indentFirstLine; + $this->lineLength = $lineLength; + } + + /** + * Generate a DocBlock comment. + * + * @param DocBlock $docblock The DocBlock to serialize. + * + * @return string The serialized doc block. + */ + public function getDocComment(DocBlock $docblock) + { + $indent = str_repeat($this->indentString, $this->indent); + $firstIndent = $this->isFirstLineIndented ? $indent : ''; + // 3 === strlen(' * ') + $wrapLength = $this->lineLength ? $this->lineLength - strlen($indent) - 3 : null; + + $text = $this->removeTrailingSpaces( + $indent, + $this->addAsterisksForEachLine( + $indent, + $this->getSummaryAndDescriptionTextBlock($docblock, $wrapLength) + ) + ); + + $comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n"; + $comment = $this->addTagBlock($docblock, $wrapLength, $indent, $comment); + $comment .= $indent . ' */'; + + return $comment; + } + + /** + * @param $indent + * @param $text + * @return mixed + */ + private function removeTrailingSpaces($indent, $text) + { + return str_replace("\n{$indent} * \n", "\n{$indent} *\n", $text); + } + + /** + * @param $indent + * @param $text + * @return mixed + */ + private function addAsterisksForEachLine($indent, $text) + { + return str_replace("\n", "\n{$indent} * ", $text); + } + + /** + * @param DocBlock $docblock + * @param $wrapLength + * @return string + */ + private function getSummaryAndDescriptionTextBlock(DocBlock $docblock, $wrapLength) + { + $text = $docblock->getSummary() . ((string)$docblock->getDescription() ? "\n\n" . $docblock->getDescription() + : ''); + if ($wrapLength !== null) { + $text = wordwrap($text, $wrapLength); + return $text; + } + return $text; + } + + /** + * @param DocBlock $docblock + * @param $wrapLength + * @param $indent + * @param $comment + * @return string + */ + private function addTagBlock(DocBlock $docblock, $wrapLength, $indent, $comment) + { + foreach ($docblock->getTags() as $tag) { + $formatter = new DocBlock\Tags\Formatter\PassthroughFormatter(); + $tagText = $formatter->format($tag); + if ($wrapLength !== null) { + $tagText = wordwrap($tagText, $wrapLength); + } + $tagText = str_replace("\n", "\n{$indent} * ", $tagText); + + $comment .= "{$indent} * {$tagText}\n"; + } + + return $comment; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php new file mode 100644 index 00000000..0a656466 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/StandardTagFactory.php @@ -0,0 +1,314 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock\Tags\Factory\StaticMethod; +use phpDocumentor\Reflection\DocBlock\Tags\Generic; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Creates a Tag object given the contents of a tag. + * + * This Factory is capable of determining the appropriate class for a tag and instantiate it using its `create` + * factory method. The `create` factory method of a Tag can have a variable number of arguments; this way you can + * pass the dependencies that you need to construct a tag object. + * + * > Important: each parameter in addition to the body variable for the `create` method must default to null, otherwise + * > it violates the constraint with the interface; it is recommended to use the {@see Assert::notNull()} method to + * > verify that a dependency is actually passed. + * + * This Factory also features a Service Locator component that is used to pass the right dependencies to the + * `create` method of a tag; each dependency should be registered as a service or as a parameter. + * + * When you want to use a Tag of your own with custom handling you need to call the `registerTagHandler` method, pass + * the name of the tag and a Fully Qualified Class Name pointing to a class that implements the Tag interface. + */ +final class StandardTagFactory implements TagFactory +{ + /** PCRE regular expression matching a tag name. */ + const REGEX_TAGNAME = '[\w\-\_\\\\]+'; + + /** + * @var string[] An array with a tag as a key, and an FQCN to a class that handles it as an array value. + */ + private $tagHandlerMappings = [ + 'author' => '\phpDocumentor\Reflection\DocBlock\Tags\Author', + 'covers' => '\phpDocumentor\Reflection\DocBlock\Tags\Covers', + 'deprecated' => '\phpDocumentor\Reflection\DocBlock\Tags\Deprecated', + // 'example' => '\phpDocumentor\Reflection\DocBlock\Tags\Example', + 'link' => '\phpDocumentor\Reflection\DocBlock\Tags\Link', + 'method' => '\phpDocumentor\Reflection\DocBlock\Tags\Method', + 'param' => '\phpDocumentor\Reflection\DocBlock\Tags\Param', + 'property-read' => '\phpDocumentor\Reflection\DocBlock\Tags\PropertyRead', + 'property' => '\phpDocumentor\Reflection\DocBlock\Tags\Property', + 'property-write' => '\phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite', + 'return' => '\phpDocumentor\Reflection\DocBlock\Tags\Return_', + 'see' => '\phpDocumentor\Reflection\DocBlock\Tags\See', + 'since' => '\phpDocumentor\Reflection\DocBlock\Tags\Since', + 'source' => '\phpDocumentor\Reflection\DocBlock\Tags\Source', + 'throw' => '\phpDocumentor\Reflection\DocBlock\Tags\Throws', + 'throws' => '\phpDocumentor\Reflection\DocBlock\Tags\Throws', + 'uses' => '\phpDocumentor\Reflection\DocBlock\Tags\Uses', + 'var' => '\phpDocumentor\Reflection\DocBlock\Tags\Var_', + 'version' => '\phpDocumentor\Reflection\DocBlock\Tags\Version' + ]; + + /** + * @var \ReflectionParameter[][] a lazy-loading cache containing parameters for each tagHandler that has been used. + */ + private $tagHandlerParameterCache = []; + + /** + * @var FqsenResolver + */ + private $fqsenResolver; + + /** + * @var mixed[] an array representing a simple Service Locator where we can store parameters and + * services that can be inserted into the Factory Methods of Tag Handlers. + */ + private $serviceLocator = []; + + /** + * Initialize this tag factory with the means to resolve an FQSEN and optionally a list of tag handlers. + * + * If no tag handlers are provided than the default list in the {@see self::$tagHandlerMappings} property + * is used. + * + * @param FqsenResolver $fqsenResolver + * @param string[] $tagHandlers + * + * @see self::registerTagHandler() to add a new tag handler to the existing default list. + */ + public function __construct(FqsenResolver $fqsenResolver, array $tagHandlers = null) + { + $this->fqsenResolver = $fqsenResolver; + if ($tagHandlers !== null) { + $this->tagHandlerMappings = $tagHandlers; + } + + $this->addService($fqsenResolver, FqsenResolver::class); + } + + /** + * {@inheritDoc} + */ + public function create($tagLine, TypeContext $context = null) + { + if (! $context) { + $context = new TypeContext(''); + } + + list($tagName, $tagBody) = $this->extractTagParts($tagLine); + + return $this->createTag($tagBody, $tagName, $context); + } + + /** + * {@inheritDoc} + */ + public function addParameter($name, $value) + { + $this->serviceLocator[$name] = $value; + } + + /** + * {@inheritDoc} + */ + public function addService($service, $alias = null) + { + $this->serviceLocator[$alias ?: get_class($service)] = $service; + } + + /** + * {@inheritDoc} + */ + public function registerTagHandler($tagName, $handler) + { + Assert::stringNotEmpty($tagName); + Assert::stringNotEmpty($handler); + Assert::classExists($handler); + Assert::implementsInterface($handler, StaticMethod::class); + + if (strpos($tagName, '\\') && $tagName[0] !== '\\') { + throw new \InvalidArgumentException( + 'A namespaced tag must have a leading backslash as it must be fully qualified' + ); + } + + $this->tagHandlerMappings[$tagName] = $handler; + } + + /** + * Extracts all components for a tag. + * + * @param string $tagLine + * + * @return string[] + */ + private function extractTagParts($tagLine) + { + $matches = array(); + if (! preg_match('/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us', $tagLine, $matches)) { + throw new \InvalidArgumentException( + 'The tag "' . $tagLine . '" does not seem to be wellformed, please check it for errors' + ); + } + + if (count($matches) < 3) { + $matches[] = ''; + } + + return array_slice($matches, 1); + } + + /** + * Creates a new tag object with the given name and body or returns null if the tag name was recognized but the + * body was invalid. + * + * @param string $body + * @param string $name + * @param TypeContext $context + * + * @return Tag|null + */ + private function createTag($body, $name, TypeContext $context) + { + $handlerClassName = $this->findHandlerClassName($name, $context); + $arguments = $this->getArgumentsForParametersFromWiring( + $this->fetchParametersForHandlerFactoryMethod($handlerClassName), + $this->getServiceLocatorWithDynamicParameters($context, $name, $body) + ) + ; + + return call_user_func_array([$handlerClassName, 'create'], $arguments); + } + + /** + * Determines the Fully Qualified Class Name of the Factory or Tag (containing a Factory Method `create`). + * + * @param string $tagName + * @param TypeContext $context + * + * @return string + */ + private function findHandlerClassName($tagName, TypeContext $context) + { + $handlerClassName = Generic::class; + if (isset($this->tagHandlerMappings[$tagName])) { + $handlerClassName = $this->tagHandlerMappings[$tagName]; + } elseif ($this->isAnnotation($tagName)) { + // TODO: Annotation support is planned for a later stage and as such is disabled for now + // $tagName = (string)$this->fqsenResolver->resolve($tagName, $context); + // if (isset($this->annotationMappings[$tagName])) { + // $handlerClassName = $this->annotationMappings[$tagName]; + // } + } + + return $handlerClassName; + } + + /** + * Retrieves the arguments that need to be passed to the Factory Method with the given Parameters. + * + * @param \ReflectionParameter[] $parameters + * @param mixed[] $locator + * + * @return mixed[] A series of values that can be passed to the Factory Method of the tag whose parameters + * is provided with this method. + */ + private function getArgumentsForParametersFromWiring($parameters, $locator) + { + $arguments = []; + foreach ($parameters as $index => $parameter) { + $typeHint = $parameter->getClass() ? $parameter->getClass()->getName() : null; + if (isset($locator[$typeHint])) { + $arguments[] = $locator[$typeHint]; + continue; + } + + $parameterName = $parameter->getName(); + if (isset($locator[$parameterName])) { + $arguments[] = $locator[$parameterName]; + continue; + } + + $arguments[] = null; + } + + return $arguments; + } + + /** + * Retrieves a series of ReflectionParameter objects for the static 'create' method of the given + * tag handler class name. + * + * @param string $handlerClassName + * + * @return \ReflectionParameter[] + */ + private function fetchParametersForHandlerFactoryMethod($handlerClassName) + { + if (! isset($this->tagHandlerParameterCache[$handlerClassName])) { + $methodReflection = new \ReflectionMethod($handlerClassName, 'create'); + $this->tagHandlerParameterCache[$handlerClassName] = $methodReflection->getParameters(); + } + + return $this->tagHandlerParameterCache[$handlerClassName]; + } + + /** + * Returns a copy of this class' Service Locator with added dynamic parameters, such as the tag's name, body and + * Context. + * + * @param TypeContext $context The Context (namespace and aliasses) that may be passed and is used to resolve FQSENs. + * @param string $tagName The name of the tag that may be passed onto the factory method of the Tag class. + * @param string $tagBody The body of the tag that may be passed onto the factory method of the Tag class. + * + * @return mixed[] + */ + private function getServiceLocatorWithDynamicParameters(TypeContext $context, $tagName, $tagBody) + { + $locator = array_merge( + $this->serviceLocator, + [ + 'name' => $tagName, + 'body' => $tagBody, + TypeContext::class => $context + ] + ); + + return $locator; + } + + /** + * Returns whether the given tag belongs to an annotation. + * + * @param string $tagContent + * + * @todo this method should be populated once we implement Annotation notation support. + * + * @return bool + */ + private function isAnnotation($tagContent) + { + // 1. Contains a namespace separator + // 2. Contains parenthesis + // 3. Is present in a list of known annotations (make the algorithm smart by first checking is the last part + // of the annotation class name matches the found tag name + + return false; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php new file mode 100644 index 00000000..e7653678 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tag.php @@ -0,0 +1,26 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +interface Tag +{ + public function getName(); + + public static function create($body); + + public function render(Formatter $formatter = null); + + public function __toString(); +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php new file mode 100644 index 00000000..3c1d1132 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/TagFactory.php @@ -0,0 +1,93 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use phpDocumentor\Reflection\Types\Context as TypeContext; + +interface TagFactory +{ + /** + * Adds a parameter to the service locator that can be injected in a tag's factory method. + * + * When calling a tag's "create" method we always check the signature for dependencies to inject. One way is to + * typehint a parameter in the signature so that we can use that interface or class name to inject a dependency + * (see {@see addService()} for more information on that). + * + * Another way is to check the name of the argument against the names in the Service Locator. With this method + * you can add a variable that will be inserted when a tag's create method is not typehinted and has a matching + * name. + * + * Be aware that there are two reserved names: + * + * - name, representing the name of the tag. + * - body, representing the complete body of the tag. + * + * These parameters are injected at the last moment and will override any existing parameter with those names. + * + * @param string $name + * @param mixed $value + * + * @return void + */ + public function addParameter($name, $value); + + /** + * Registers a service with the Service Locator using the FQCN of the class or the alias, if provided. + * + * When calling a tag's "create" method we always check the signature for dependencies to inject. If a parameter + * has a typehint then the ServiceLocator is queried to see if a Service is registered for that typehint. + * + * Because interfaces are regularly used as type-hints this method provides an alias parameter; if the FQCN of the + * interface is passed as alias then every time that interface is requested the provided service will be returned. + * + * @param object $service + * @param string $alias + * + * @return void + */ + public function addService($service); + + /** + * Factory method responsible for instantiating the correct sub type. + * + * @param string $tagLine The text for this tag, including description. + * @param TypeContext $context + * + * @throws \InvalidArgumentException if an invalid tag line was presented. + * + * @return Tag A new tag object. + */ + public function create($tagLine, TypeContext $context = null); + + /** + * Registers a handler for tags. + * + * If you want to use your own tags then you can use this method to instruct the TagFactory to register the name + * of a tag with the FQCN of a 'Tag Handler'. The Tag handler should implement the {@see Tag} interface (and thus + * the create method). + * + * @param string $tagName Name of tag to register a handler for. When registering a namespaced tag, the full + * name, along with a prefixing slash MUST be provided. + * @param string $handler FQCN of handler. + * + * @throws \InvalidArgumentException if the tag name is not a string + * @throws \InvalidArgumentException if the tag name is namespaced (contains backslashes) but does not start with + * a backslash + * @throws \InvalidArgumentException if the handler is not a string + * @throws \InvalidArgumentException if the handler is not an existing class + * @throws \InvalidArgumentException if the handler does not implement the {@see Tag} interface + * + * @return void + */ + public function registerTagHandler($tagName, $handler); +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php new file mode 100644 index 00000000..41a27886 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Author.php @@ -0,0 +1,100 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Webmozart\Assert\Assert; + +/** + * Reflection class for an {@}author tag in a Docblock. + */ +final class Author extends BaseTag implements Factory\StaticMethod +{ + /** @var string register that this is the author tag. */ + protected $name = 'author'; + + /** @var string The name of the author */ + private $authorName = ''; + + /** @var string The email of the author */ + private $authorEmail = ''; + + /** + * Initializes this tag with the author name and e-mail. + * + * @param string $authorName + * @param string $authorEmail + */ + public function __construct($authorName, $authorEmail) + { + Assert::string($authorName); + Assert::string($authorEmail); + if ($authorEmail && !filter_var($authorEmail, FILTER_VALIDATE_EMAIL)) { + throw new \InvalidArgumentException('The author tag does not have a valid e-mail address'); + } + + $this->authorName = $authorName; + $this->authorEmail = $authorEmail; + } + + /** + * Gets the author's name. + * + * @return string The author's name. + */ + public function getAuthorName() + { + return $this->authorName; + } + + /** + * Returns the author's email. + * + * @return string The author's email. + */ + public function getEmail() + { + return $this->authorEmail; + } + + /** + * Returns this tag in string form. + * + * @return string + */ + public function __toString() + { + return $this->authorName . '<' . $this->authorEmail . '>'; + } + + /** + * Attempts to create a new Author object based on †he tag body. + * + * @param string $body + * + * @return static + */ + public static function create($body) + { + Assert::string($body); + + $splitTagContent = preg_match('/^([^\<]*)(?:\<([^\>]*)\>)?$/u', $body, $matches); + if (!$splitTagContent) { + return null; + } + + $authorName = trim($matches[1]); + $email = isset($matches[2]) ? trim($matches[2]) : ''; + + return new static($authorName, $email); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php new file mode 100644 index 00000000..14bb7177 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/BaseTag.php @@ -0,0 +1,52 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock; +use phpDocumentor\Reflection\DocBlock\Description; + +/** + * Parses a tag definition for a DocBlock. + */ +abstract class BaseTag implements DocBlock\Tag +{ + /** @var string Name of the tag */ + protected $name = ''; + + /** @var Description|null Description of the tag. */ + protected $description; + + /** + * Gets the name of this tag. + * + * @return string The name of this tag. + */ + public function getName() + { + return $this->name; + } + + public function getDescription() + { + return $this->description; + } + + public function render(Formatter $formatter = null) + { + if ($formatter === null) { + $formatter = new Formatter\PassthroughFormatter(); + } + + return $formatter->format($this); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php new file mode 100644 index 00000000..31b4f82c --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Covers.php @@ -0,0 +1,84 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use phpDocumentor\Reflection\FqsenResolver; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a @covers tag in a Docblock. + */ +final class Covers extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'covers'; + + /** @var Fqsen */ + private $refers = null; + + /** + * Initializes this tag. + * + * @param Fqsen $refers + * @param Description $description + */ + public function __construct(Fqsen $refers, Description $description = null) + { + $this->refers = $refers; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + DescriptionFactory $descriptionFactory = null, + FqsenResolver $resolver = null, + TypeContext $context = null + ) + { + Assert::string($body); + Assert::notEmpty($body); + + $parts = preg_split('/\s+/Su', $body, 2); + + return new static( + $resolver->resolve($parts[0], $context), + $descriptionFactory->create(isset($parts[1]) ? $parts[1] : '', $context) + ); + } + + /** + * Returns the structural element this tag refers to. + * + * @return Fqsen + */ + public function getReference() + { + return $this->refers; + } + + /** + * Returns a string representation of this tag. + * + * @return string + */ + public function __toString() + { + return $this->refers . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php new file mode 100644 index 00000000..d3a0bd7b --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Deprecated.php @@ -0,0 +1,94 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\Types\Context as TypeContext; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}deprecated tag in a Docblock. + */ +final class Deprecated extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'deprecated'; + + /** + * PCRE regular expression matching a version vector. + * Assumes the "x" modifier. + */ + const REGEX_VECTOR = '(?: + # Normal release vectors. + \d\S* + | + # VCS version vectors. Per PHPCS, they are expected to + # follow the form of the VCS name, followed by ":", followed + # by the version vector itself. + # By convention, popular VCSes like CVS, SVN and GIT use "$" + # around the actual version vector. + [^\s\:]+\:\s*\$[^\$]+\$ + )'; + + /** @var string The version vector. */ + private $version = ''; + + public function __construct($version = null, Description $description = null) + { + Assert::nullOrStringNotEmpty($version); + + $this->version = $version; + $this->description = $description; + } + + /** + * @return static + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::nullOrString($body); + if (empty($body)) { + return new static(); + } + + $matches = []; + if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { + return null; + } + + return new static( + $matches[1], + $descriptionFactory->create(isset($matches[2]) ? $matches[2] : '', $context) + ); + } + + /** + * Gets the version section of the tag. + * + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->version . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php new file mode 100644 index 00000000..571ef8df --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Example.php @@ -0,0 +1,158 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Tag; + +/** + * Reflection class for a {@}example tag in a Docblock. + */ +final class Example extends BaseTag +{ + /** + * @var string Path to a file to use as an example. May also be an absolute URI. + */ + private $filePath = ''; + + /** + * @var bool Whether the file path component represents an URI. This determines how the file portion + * appears at {@link getContent()}. + */ + private $isURI = false; + + /** + * {@inheritdoc} + */ + public function getContent() + { + if (null === $this->description) { + $filePath = '"' . $this->filePath . '"'; + if ($this->isURI) { + $filePath = $this->isUriRelative($this->filePath) + ? str_replace('%2F', '/', rawurlencode($this->filePath)) + :$this->filePath; + } + + $this->description = $filePath . ' ' . parent::getContent(); + } + + return $this->description; + } + + /** + * {@inheritdoc} + */ + public static function create($body) + { + // File component: File path in quotes or File URI / Source information + if (! preg_match('/^(?:\"([^\"]+)\"|(\S+))(?:\s+(.*))?$/sux', $body, $matches)) { + return null; + } + + $filePath = null; + $fileUri = null; + if ('' !== $matches[1]) { + $filePath = $matches[1]; + } else { + $fileUri = $matches[2]; + } + + $startingLine = 1; + $lineCount = null; + $description = null; + + // Starting line / Number of lines / Description + if (preg_match('/^([1-9]\d*)\s*(?:((?1))\s+)?(.*)$/sux', $matches[3], $matches)) { + $startingLine = (int)$matches[1]; + if (isset($matches[2]) && $matches[2] !== '') { + $lineCount = (int)$matches[2]; + } + $description = $matches[3]; + } + + return new static($filePath, $fileUri, $startingLine, $lineCount, $description); + } + + /** + * Returns the file path. + * + * @return string Path to a file to use as an example. + * May also be an absolute URI. + */ + public function getFilePath() + { + return $this->filePath; + } + + /** + * Sets the file path. + * + * @param string $filePath The new file path to use for the example. + * + * @return $this + */ + public function setFilePath($filePath) + { + $this->isURI = false; + $this->filePath = trim($filePath); + + $this->description = null; + return $this; + } + + /** + * Sets the file path as an URI. + * + * This function is equivalent to {@link setFilePath()}, except that it + * converts an URI to a file path before that. + * + * There is no getFileURI(), as {@link getFilePath()} is compatible. + * + * @param string $uri The new file URI to use as an example. + * + * @return $this + */ + public function setFileURI($uri) + { + $this->isURI = true; + $this->description = null; + + $this->filePath = $this->isUriRelative($uri) + ? rawurldecode(str_replace(array('/', '\\'), '%2F', $uri)) + : $this->filePath = $uri; + + return $this; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->filePath . ($this->description ? ' ' . $this->description->render() : ''); + } + + /** + * Returns true if the provided URI is relative or contains a complete scheme (and thus is absolute). + * + * @param string $uri + * + * @return bool + */ + private function isUriRelative($uri) + { + return false === strpos($uri, ':'); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/StaticMethod.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/StaticMethod.php new file mode 100644 index 00000000..98aea455 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/StaticMethod.php @@ -0,0 +1,18 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Factory; + +interface StaticMethod +{ + public static function create($body); +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/Strategy.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/Strategy.php new file mode 100644 index 00000000..b9ca0b8a --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Factory/Strategy.php @@ -0,0 +1,18 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Factory; + +interface Strategy +{ + public function create($body); +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php new file mode 100644 index 00000000..64b2c603 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter.php @@ -0,0 +1,27 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Tag; + +interface Formatter +{ + /** + * Formats a tag into a string representation according to a specific format, such as Markdown. + * + * @param Tag $tag + * + * @return string + */ + public function format(Tag $tag); +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php new file mode 100644 index 00000000..aa97572c --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Formatter/PassthroughFormatter.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +class PassthroughFormatter implements Formatter +{ + /** + * Formats the given tag to return a simple plain text version. + * + * @param Tag $tag + * + * @return string + */ + public function format(Tag $tag) + { + return '@' . $tag->getName() . ' ' . (string)$tag; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php new file mode 100644 index 00000000..e4c53e00 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Generic.php @@ -0,0 +1,91 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\DocBlock\StandardTagFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Parses a tag definition for a DocBlock. + */ +class Generic extends BaseTag implements Factory\StaticMethod +{ + /** + * Parses a tag and populates the member variables. + * + * @param string $name Name of the tag. + * @param Description $description The contents of the given tag. + */ + public function __construct($name, Description $description = null) + { + $this->validateTagName($name); + + $this->name = $name; + $this->description = $description; + } + + /** + * Creates a new tag that represents any unknown tag type. + * + * @param string $body + * @param string $name + * @param DescriptionFactory $descriptionFactory + * @param TypeContext $context + * + * @return static + */ + public static function create( + $body, + $name = '', + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::stringNotEmpty($name); + Assert::notNull($descriptionFactory); + + $description = $descriptionFactory && $body ? $descriptionFactory->create($body, $context) : null; + + return new static($name, $description); + } + + /** + * Returns the tag as a serialized string + * + * @return string + */ + public function __toString() + { + return ($this->description ? $this->description->render() : ''); + } + + /** + * Validates if the tag name matches the expected format, otherwise throws an exception. + * + * @param string $name + * + * @return void + */ + private function validateTagName($name) + { + if (! preg_match('/^' . StandardTagFactory::REGEX_TAGNAME . '$/u', $name)) { + throw new \InvalidArgumentException( + 'The tag name "' . $name . '" is not wellformed. Tags may only consist of letters, underscores, ' + . 'hyphens and backslashes.' + ); + } + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php new file mode 100644 index 00000000..9c0e367e --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Link.php @@ -0,0 +1,77 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a @link tag in a Docblock. + */ +final class Link extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'link'; + + /** @var string */ + private $link = ''; + + /** + * Initializes a link to a URL. + * + * @param string $link + * @param Description $description + */ + public function __construct($link, Description $description = null) + { + Assert::string($link); + + $this->link = $link; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::string($body); + Assert::notNull($descriptionFactory); + + $parts = preg_split('/\s+/Su', $body, 2); + $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null; + + return new static($parts[0], $description); + } + + /** + * Gets the link + * + * @return string + */ + public function getLink() + { + return $this->link; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->link . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php new file mode 100644 index 00000000..72dd1a0a --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Method.php @@ -0,0 +1,220 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use phpDocumentor\Reflection\Types\Void_; +use Webmozart\Assert\Assert; + +/** + * Reflection class for an {@}method in a Docblock. + */ +final class Method extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'method'; + + /** @var string */ + private $methodName = ''; + + /** @var string[] */ + private $arguments = []; + + /** @var bool */ + private $isStatic = false; + + /** @var Type */ + private $returnType; + + public function __construct( + $methodName, + array $arguments = [], + Type $returnType = null, + $static = false, + Description $description = null + ) { + Assert::stringNotEmpty($methodName); + Assert::boolean($static); + + if ($returnType === null) { + $returnType = new Void_(); + } + + $this->methodName = $methodName; + $this->arguments = $this->filterArguments($arguments); + $this->returnType = $returnType; + $this->isStatic = $static; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([ $typeResolver, $descriptionFactory ]); + + // 1. none or more whitespace + // 2. optionally the keyword "static" followed by whitespace + // 3. optionally a word with underscores followed by whitespace : as + // type for the return value + // 4. then optionally a word with underscores followed by () and + // whitespace : as method name as used by phpDocumentor + // 5. then a word with underscores, followed by ( and any character + // until a ) and whitespace : as method name with signature + // 6. any remaining text : as description + if (!preg_match( + '/^ + # Static keyword + # Declares a static method ONLY if type is also present + (?: + (static) + \s+ + )? + # Return type + (?: + ( + (?:[\w\|_\\\\]+) + # array notation + (?:\[\])* + )? + \s+ + )? + # Legacy method name (not captured) + (?: + [\w_]+\(\)\s+ + )? + # Method name + ([\w\|_\\\\]+) + # Arguments + (?: + \(([^\)]*)\) + )? + \s* + # Description + (.*) + $/sux', + $body, + $matches + )) { + return null; + } + + list(, $static, $returnType, $methodName, $arguments, $description) = $matches; + + $static = $static === 'static'; + $returnType = $typeResolver->resolve($returnType, $context); + $description = $descriptionFactory->create($description, $context); + + if ('' !== $arguments) { + $arguments = explode(',', $arguments); + foreach($arguments as &$argument) { + $argument = explode(' ', trim($argument)); + if ($argument[0][0] === '$') { + $argumentName = substr($argument[0], 1); + $argumentType = new Void_(); + } else { + $argumentType = $typeResolver->resolve($argument[0], $context); + $argumentName = ''; + if (isset($argument[1])) { + $argumentName = substr($argument[1], 1); + } + } + + $argument = [ 'name' => $argumentName, 'type' => $argumentType]; + } + } else { + $arguments = []; + } + + return new static($methodName, $arguments, $returnType, $static, $description); + } + + /** + * Retrieves the method name. + * + * @return string + */ + public function getMethodName() + { + return $this->methodName; + } + + /** + * @return string[] + */ + public function getArguments() + { + return $this->arguments; + } + + /** + * Checks whether the method tag describes a static method or not. + * + * @return bool TRUE if the method declaration is for a static method, FALSE otherwise. + */ + public function isStatic() + { + return $this->isStatic; + } + + /** + * @return Type + */ + public function getReturnType() + { + return $this->returnType; + } + + public function __toString() + { + $arguments = []; + foreach ($this->arguments as $argument) { + $arguments[] = $argument['type'] . ' $' . $argument['name']; + } + + return ($this->isStatic() ? 'static ' : '') + . (string)$this->returnType . ' ' + . $this->methodName + . '(' . implode(', ', $arguments) . ')' + . ($this->description ? ' ' . $this->description->render() : ''); + } + + private function filterArguments($arguments) + { + foreach ($arguments as &$argument) { + if (is_string($argument)) { + $argument = [ 'name' => $argument ]; + } + if (! isset($argument['type'])) { + $argument['type'] = new Void_(); + } + $keys = array_keys($argument); + if ($keys !== [ 'name', 'type' ]) { + throw new \InvalidArgumentException( + 'Arguments can only have the "name" and "type" fields, found: ' . var_export($keys, true) + ); + } + } + + return $arguments; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php new file mode 100644 index 00000000..1a51dc0d --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Param.php @@ -0,0 +1,141 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for the {@}param tag in a Docblock. + */ +final class Param extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'param'; + + /** @var Type */ + private $type; + + /** @var string */ + private $variableName = ''; + + /** @var bool determines whether this is a variadic argument */ + private $isVariadic = false; + + /** + * @param string $variableName + * @param Type $type + * @param bool $isVariadic + * @param Description $description + */ + public function __construct($variableName, Type $type = null, $isVariadic = false, Description $description = null) + { + Assert::string($variableName); + Assert::boolean($isVariadic); + + $this->variableName = $variableName; + $this->type = $type; + $this->isVariadic = $isVariadic; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + $isVariadic = false; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 3) === '...') { + $isVariadic = true; + $variableName = substr($variableName, 3); + } + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $isVariadic, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns whether this tag is variadic. + * + * @return boolean + */ + public function isVariadic() + { + return $this->isVariadic; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . ($this->isVariadic() ? '...' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php new file mode 100644 index 00000000..3c597133 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Property.php @@ -0,0 +1,118 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}property tag in a Docblock. + */ +class Property extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'property'; + + /** @var Type */ + private $type; + + /** @var string */ + protected $variableName = ''; + + /** + * @param string $variableName + * @param Type $type + * @param Description $description + */ + public function __construct($variableName, Type $type = null, Description $description = null) + { + Assert::string($variableName); + + $this->variableName = $variableName; + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php new file mode 100644 index 00000000..bf2b8056 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyRead.php @@ -0,0 +1,118 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}property-read tag in a Docblock. + */ +class PropertyRead extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'property-read'; + + /** @var Type */ + private $type; + + /** @var string */ + protected $variableName = ''; + + /** + * @param string $variableName + * @param Type $type + * @param Description $description + */ + public function __construct($variableName, Type $type = null, Description $description = null) + { + Assert::string($variableName); + + $this->variableName = $variableName; + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php new file mode 100644 index 00000000..db37e0fb --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/PropertyWrite.php @@ -0,0 +1,118 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}property-write tag in a Docblock. + */ +class PropertyWrite extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'property-write'; + + /** @var Type */ + private $type; + + /** @var string */ + protected $variableName = ''; + + /** + * @param string $variableName + * @param Type $type + * @param Description $description + */ + public function __construct($variableName, Type $type = null, Description $description = null) + { + Assert::string($variableName); + + $this->variableName = $variableName; + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php new file mode 100644 index 00000000..09a5870e --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Return_.php @@ -0,0 +1,73 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}return tag in a Docblock. + */ +final class Return_ extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'return'; + + /** @var Type */ + private $type; + + public function __construct(Type $type, Description $description = null) + { + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) + { + Assert::string($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/\s+/Su', $body, 2); + + $type = $typeResolver->resolve(isset($parts[0]) ? $parts[0] : '', $context); + $description = $descriptionFactory->create(isset($parts[1]) ? $parts[1] : '', $context); + + return new static($type, $description); + } + + /** + * Returns the type section of the variable. + * + * @return Type + */ + public function getType() + { + return $this->type; + } + + public function __toString() + { + return $this->type . ' ' . $this->description; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php new file mode 100644 index 00000000..64ee3d8e --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/See.php @@ -0,0 +1,81 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use phpDocumentor\Reflection\DocBlock\Description; +use Webmozart\Assert\Assert; + +/** + * Reflection class for an {@}see tag in a Docblock. + */ +class See extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'see'; + + /** @var Fqsen */ + protected $refers = null; + + /** + * Initializes this tag. + * + * @param Fqsen $refers + * @param Description $description + */ + public function __construct(Fqsen $refers, Description $description = null) + { + $this->refers = $refers; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + FqsenResolver $resolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::allNotNull([$resolver, $descriptionFactory]); + + $parts = preg_split('/\s+/Su', $body, 2); + $description = isset($parts[1]) ? $descriptionFactory->create($parts[1], $context) : null; + + return new static($resolver->resolve($parts[0], $context), $description); + } + + /** + * Returns the structural element this tag refers to. + * + * @return Fqsen + */ + public function getReference() + { + return $this->refers; + } + + /** + * Returns a string representation of this tag. + * + * @return string + */ + public function __toString() + { + return $this->refers . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php new file mode 100644 index 00000000..3d002ed3 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Since.php @@ -0,0 +1,94 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\Types\Context as TypeContext; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}since tag in a Docblock. + */ +final class Since extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'since'; + + /** + * PCRE regular expression matching a version vector. + * Assumes the "x" modifier. + */ + const REGEX_VECTOR = '(?: + # Normal release vectors. + \d\S* + | + # VCS version vectors. Per PHPCS, they are expected to + # follow the form of the VCS name, followed by ":", followed + # by the version vector itself. + # By convention, popular VCSes like CVS, SVN and GIT use "$" + # around the actual version vector. + [^\s\:]+\:\s*\$[^\$]+\$ + )'; + + /** @var string The version vector. */ + private $version = ''; + + public function __construct($version = null, Description $description = null) + { + Assert::nullOrStringNotEmpty($version); + + $this->version = $version; + $this->description = $description; + } + + /** + * @return static + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::nullOrString($body); + if (empty($body)) { + return new static(); + } + + $matches = []; + if (! preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { + return null; + } + + return new static( + $matches[1], + $descriptionFactory->create(isset($matches[2]) ? $matches[2] : '', $context) + ); + } + + /** + * Gets the version section of the tag. + * + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->version . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php new file mode 100644 index 00000000..b0646b96 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Source.php @@ -0,0 +1,96 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}source tag in a Docblock. + */ +final class Source extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'source'; + + /** @var int The starting line, relative to the structural element's location. */ + private $startingLine = 1; + + /** @var int|null The number of lines, relative to the starting line. NULL means "to the end". */ + private $lineCount = null; + + public function __construct($startingLine, $lineCount = null, Description $description = null) + { + Assert::integerish($startingLine); + Assert::nullOrIntegerish($lineCount); + + $this->startingLine = (int)$startingLine; + $this->lineCount = $lineCount !== null ? (int)$lineCount : null; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::stringNotEmpty($body); + Assert::notNull($descriptionFactory); + + $startingLine = 1; + $lineCount = null; + $description = null; + + // Starting line / Number of lines / Description + if (preg_match('/^([1-9]\d*)\s*(?:((?1))\s+)?(.*)$/sux', $body, $matches)) { + $startingLine = (int)$matches[1]; + if (isset($matches[2]) && $matches[2] !== '') { + $lineCount = (int)$matches[2]; + } + $description = $matches[3]; + } + + return new static($startingLine, $lineCount, $descriptionFactory->create($description, $context)); + } + + /** + * Gets the starting line. + * + * @return int The starting line, relative to the structural element's + * location. + */ + public function getStartingLine() + { + return $this->startingLine; + } + + /** + * Returns the number of lines. + * + * @return int|null The number of lines, relative to the starting line. NULL + * means "to the end". + */ + public function getLineCount() + { + return $this->lineCount; + } + + public function __toString() + { + return $this->startingLine + . ($this->lineCount !== null ? ' ' . $this->lineCount : '') + . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php new file mode 100644 index 00000000..349e773b --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Throws.php @@ -0,0 +1,72 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}throws tag in a Docblock. + */ +final class Throws extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'throws'; + + /** @var Type */ + private $type; + + public function __construct(Type $type, Description $description = null) + { + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/\s+/Su', $body, 2); + + $type = $typeResolver->resolve(isset($parts[0]) ? $parts[0] : '', $context); + $description = $descriptionFactory->create(isset($parts[1]) ? $parts[1] : '', $context); + + return new static($type, $description); + } + + /** + * Returns the type section of the variable. + * + * @return Type + */ + public function getType() + { + return $this->type; + } + + public function __toString() + { + return $this->type . ' ' . $this->description; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php new file mode 100644 index 00000000..00dc3e3b --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Uses.php @@ -0,0 +1,83 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}uses tag in a Docblock. + */ +final class Uses extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'uses'; + + /** @var Fqsen */ + protected $refers = null; + + /** + * Initializes this tag. + * + * @param Fqsen $refers + * @param Description $description + */ + public function __construct(Fqsen $refers, Description $description = null) + { + $this->refers = $refers; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + FqsenResolver $resolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::string($body); + Assert::allNotNull([$resolver, $descriptionFactory]); + + $parts = preg_split('/\s+/Su', $body, 2); + + return new static( + $resolver->resolve($parts[0], $context), + $descriptionFactory->create(isset($parts[1]) ? $parts[1] : '', $context) + ); + } + + /** + * Returns the structural element this tag refers to. + * + * @return Fqsen + */ + public function getReference() + { + return $this->refers; + } + + /** + * Returns a string representation of this tag. + * + * @return string + */ + public function __toString() + { + return $this->refers . ' ' . $this->description->render(); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php new file mode 100644 index 00000000..e23c694b --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Var_.php @@ -0,0 +1,118 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Type; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context as TypeContext; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}var tag in a Docblock. + */ +class Var_ extends BaseTag implements Factory\StaticMethod +{ + /** @var string */ + protected $name = 'var'; + + /** @var Type */ + private $type; + + /** @var string */ + protected $variableName = ''; + + /** + * @param string $variableName + * @param Type $type + * @param Description $description + */ + public function __construct($variableName, Type $type = null, Description $description = null) + { + Assert::string($variableName); + + $this->variableName = $variableName; + $this->type = $type; + $this->description = $description; + } + + /** + * {@inheritdoc} + */ + public static function create( + $body, + TypeResolver $typeResolver = null, + DescriptionFactory $descriptionFactory = null, + TypeContext $context = null + ) { + Assert::stringNotEmpty($body); + Assert::allNotNull([$typeResolver, $descriptionFactory]); + + $parts = preg_split('/(\s+)/Su', $body, 3, PREG_SPLIT_DELIM_CAPTURE); + $type = null; + $variableName = ''; + + // if the first item that is encountered is not a variable; it is a type + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] !== '$')) { + $type = $typeResolver->resolve(array_shift($parts), $context); + array_shift($parts); + } + + // if the next item starts with a $ or ...$ it must be the variable name + if (isset($parts[0]) && (strlen($parts[0]) > 0) && ($parts[0][0] == '$')) { + $variableName = array_shift($parts); + array_shift($parts); + + if (substr($variableName, 0, 1) === '$') { + $variableName = substr($variableName, 1); + } + } + + $description = $descriptionFactory->create(implode('', $parts), $context); + + return new static($variableName, $type, $description); + } + + /** + * Returns the variable's name. + * + * @return string + */ + public function getVariableName() + { + return $this->variableName; + } + + /** + * Returns the variable's type or null if unknown. + * + * @return Type|null + */ + public function getType() + { + return $this->type; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return ($this->type ? $this->type . ' ' : '') + . '$' . $this->variableName + . ($this->description ? ' ' . $this->description : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php new file mode 100644 index 00000000..3e0e5bef --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlock/Tags/Version.php @@ -0,0 +1,94 @@ + + * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use phpDocumentor\Reflection\Types\Context as TypeContext; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use Webmozart\Assert\Assert; + +/** + * Reflection class for a {@}version tag in a Docblock. + */ +final class Version extends BaseTag implements Factory\StaticMethod +{ + protected $name = 'version'; + + /** + * PCRE regular expression matching a version vector. + * Assumes the "x" modifier. + */ + const REGEX_VECTOR = '(?: + # Normal release vectors. + \d\S* + | + # VCS version vectors. Per PHPCS, they are expected to + # follow the form of the VCS name, followed by ":", followed + # by the version vector itself. + # By convention, popular VCSes like CVS, SVN and GIT use "$" + # around the actual version vector. + [^\s\:]+\:\s*\$[^\$]+\$ + )'; + + /** @var string The version vector. */ + private $version = ''; + + public function __construct($version = null, Description $description = null) + { + Assert::nullOrStringNotEmpty($version); + + $this->version = $version; + $this->description = $description; + } + + /** + * @return static + */ + public static function create($body, DescriptionFactory $descriptionFactory = null, TypeContext $context = null) + { + Assert::nullOrString($body); + if (empty($body)) { + return new static(); + } + + $matches = []; + if (!preg_match('/^(' . self::REGEX_VECTOR . ')\s*(.+)?$/sux', $body, $matches)) { + return null; + } + + return new static( + $matches[1], + $descriptionFactory->create(isset($matches[2]) ? $matches[2] : '', $context) + ); + } + + /** + * Gets the version section of the tag. + * + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * Returns a string representation for this tag. + * + * @return string + */ + public function __toString() + { + return $this->version . ($this->description ? ' ' . $this->description->render() : ''); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php new file mode 100644 index 00000000..9ec2455d --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php @@ -0,0 +1,277 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\DocBlock\StandardTagFactory; +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\TagFactory; +use Webmozart\Assert\Assert; + +final class DocBlockFactory implements DocBlockFactoryInterface +{ + /** @var DocBlock\DescriptionFactory */ + private $descriptionFactory; + + /** @var DocBlock\TagFactory */ + private $tagFactory; + + /** + * Initializes this factory with the required subcontractors. + * + * @param DescriptionFactory $descriptionFactory + * @param TagFactory $tagFactory + */ + public function __construct(DescriptionFactory $descriptionFactory, TagFactory $tagFactory) + { + $this->descriptionFactory = $descriptionFactory; + $this->tagFactory = $tagFactory; + } + + /** + * Factory method for easy instantiation. + * + * @param string[] $additionalTags + * + * @return DocBlockFactory + */ + public static function createInstance(array $additionalTags = []) + { + $fqsenResolver = new FqsenResolver(); + $tagFactory = new StandardTagFactory($fqsenResolver); + $descriptionFactory = new DescriptionFactory($tagFactory); + + $tagFactory->addService($descriptionFactory); + $tagFactory->addService(new TypeResolver($fqsenResolver)); + + $docBlockFactory = new self($descriptionFactory, $tagFactory); + foreach ($additionalTags as $tagName => $tagHandler) { + $docBlockFactory->registerTagHandler($tagName, $tagHandler); + } + + return $docBlockFactory; + } + + /** + * @param object|string $docblock A string containing the DocBlock to parse or an object supporting the + * getDocComment method (such as a ReflectionClass object). + * @param Types\Context $context + * @param Location $location + * + * @return DocBlock + */ + public function create($docblock, Types\Context $context = null, Location $location = null) + { + if (is_object($docblock)) { + if (!method_exists($docblock, 'getDocComment')) { + $exceptionMessage = 'Invalid object passed; the given object must support the getDocComment method'; + throw new \InvalidArgumentException($exceptionMessage); + } + + $docblock = $docblock->getDocComment(); + } + + Assert::stringNotEmpty($docblock); + + if ($context === null) { + $context = new Types\Context(''); + } + + $parts = $this->splitDocBlock($this->stripDocComment($docblock)); + list($templateMarker, $summary, $description, $tags) = $parts; + + return new DocBlock( + $summary, + $description ? $this->descriptionFactory->create($description, $context) : null, + array_filter($this->parseTagBlock($tags, $context), function($tag) { + return $tag instanceof Tag; + }), + $context, + $location, + $templateMarker === '#@+', + $templateMarker === '#@-' + ); + } + + public function registerTagHandler($tagName, $handler) + { + $this->tagFactory->registerTagHandler($tagName, $handler); + } + + /** + * Strips the asterisks from the DocBlock comment. + * + * @param string $comment String containing the comment text. + * + * @return string + */ + private function stripDocComment($comment) + { + $comment = trim(preg_replace('#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', '$1', $comment)); + + // reg ex above is not able to remove */ from a single line docblock + if (substr($comment, -2) == '*/') { + $comment = trim(substr($comment, 0, -2)); + } + + return str_replace(array("\r\n", "\r"), "\n", $comment); + } + + /** + * Splits the DocBlock into a template marker, summary, description and block of tags. + * + * @param string $comment Comment to split into the sub-parts. + * + * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split. + * @author Mike van Riel for extending the regex with template marker support. + * + * @return string[] containing the template marker (if any), summary, description and a string containing the tags. + */ + private function splitDocBlock($comment) + { + // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This + // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the + // performance impact of running a regular expression + if (strpos($comment, '@') === 0) { + return array('', '', '', $comment); + } + + // clears all extra horizontal whitespace from the line endings to prevent parsing issues + $comment = preg_replace('/\h*$/Sum', '', $comment); + + /* + * Splits the docblock into a template marker, summary, description and tags section. + * + * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may + * occur after it and will be stripped). + * - The short description is started from the first character until a dot is encountered followed by a + * newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing + * errors). This is optional. + * - The long description, any character until a new line is encountered followed by an @ and word + * characters (a tag). This is optional. + * - Tags; the remaining characters + * + * Big thanks to RichardJ for contributing this Regular Expression + */ + preg_match( + '/ + \A + # 1. Extract the template marker + (?:(\#\@\+|\#\@\-)\n?)? + + # 2. Extract the summary + (?: + (?! @\pL ) # The summary may not start with an @ + ( + [^\n.]+ + (?: + (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines + [\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line + [^\n.]+ # Include anything else + )* + \.? + )? + ) + + # 3. Extract the description + (?: + \s* # Some form of whitespace _must_ precede a description because a summary must be there + (?! @\pL ) # The description may not start with an @ + ( + [^\n]+ + (?: \n+ + (?! [ \t]* @\pL ) # End description when an @ is found as first character on a new line + [^\n]+ # Include anything else + )* + ) + )? + + # 4. Extract the tags (anything that follows) + (\s+ [\s\S]*)? # everything that follows + /ux', + $comment, + $matches + ); + array_shift($matches); + + while (count($matches) < 4) { + $matches[] = ''; + } + + return $matches; + } + + /** + * Creates the tag objects. + * + * @param string $tags Tag block to parse. + * @param Types\Context $context Context of the parsed Tag + * + * @return DocBlock\Tag[] + */ + private function parseTagBlock($tags, Types\Context $context) + { + $tags = $this->filterTagBlock($tags); + if (!$tags) { + return []; + } + + $result = $this->splitTagBlockIntoTagLines($tags); + foreach ($result as $key => $tagLine) { + $result[$key] = $this->tagFactory->create(trim($tagLine), $context); + } + + return $result; + } + + /** + * @param string $tags + * + * @return string[] + */ + private function splitTagBlockIntoTagLines($tags) + { + $result = array(); + foreach (explode("\n", $tags) as $tag_line) { + if (isset($tag_line[0]) && ($tag_line[0] === '@')) { + $result[] = $tag_line; + } else { + $result[count($result) - 1] .= "\n" . $tag_line; + } + } + + return $result; + } + + /** + * @param $tags + * @return string + */ + private function filterTagBlock($tags) + { + $tags = trim($tags); + if (!$tags) { + return null; + } + + if ('@' !== $tags[0]) { + // @codeCoverageIgnoreStart + // Can't simulate this; this only happens if there is an error with the parsing of the DocBlock that + // we didn't foresee. + throw new \LogicException('A tag block started with text instead of an at-sign(@): ' . $tags); + // @codeCoverageIgnoreEnd + } + + return $tags; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php new file mode 100644 index 00000000..b3533429 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactoryInterface.php @@ -0,0 +1,23 @@ + - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection; - -use phpDocumentor\Reflection\DocBlock\Tag; -use phpDocumentor\Reflection\DocBlock\Context; -use phpDocumentor\Reflection\DocBlock\Location; - -/** - * Parses the DocBlock for any structure. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DocBlock implements \Reflector -{ - /** @var string The opening line for this docblock. */ - protected $short_description = ''; - - /** - * @var DocBlock\Description The actual - * description for this docblock. - */ - protected $long_description = null; - - /** - * @var Tag[] An array containing all - * the tags in this docblock; except inline. - */ - protected $tags = array(); - - /** @var Context Information about the context of this DocBlock. */ - protected $context = null; - - /** @var Location Information about the location of this DocBlock. */ - protected $location = null; - - /** @var bool Is this DocBlock (the start of) a template? */ - protected $isTemplateStart = false; - - /** @var bool Does this DocBlock signify the end of a DocBlock template? */ - protected $isTemplateEnd = false; - - /** - * Parses the given docblock and populates the member fields. - * - * The constructor may also receive namespace information such as the - * current namespace and aliases. This information is used by some tags - * (e.g. @return, @param, etc.) to turn a relative Type into a FQCN. - * - * @param \Reflector|string $docblock A docblock comment (including - * asterisks) or reflector supporting the getDocComment method. - * @param Context $context The context in which the DocBlock - * occurs. - * @param Location $location The location within the file that this - * DocBlock occurs in. - * - * @throws \InvalidArgumentException if the given argument does not have the - * getDocComment method. - */ - public function __construct( - $docblock, - Context $context = null, - Location $location = null - ) { - if (is_object($docblock)) { - if (!method_exists($docblock, 'getDocComment')) { - throw new \InvalidArgumentException( - 'Invalid object passed; the given reflector must support ' - . 'the getDocComment method' - ); - } - - $docblock = $docblock->getDocComment(); - } - - $docblock = $this->cleanInput($docblock); - - list($templateMarker, $short, $long, $tags) = $this->splitDocBlock($docblock); - $this->isTemplateStart = $templateMarker === '#@+'; - $this->isTemplateEnd = $templateMarker === '#@-'; - $this->short_description = $short; - $this->long_description = new DocBlock\Description($long, $this); - $this->parseTags($tags); - - $this->context = $context; - $this->location = $location; - } - - /** - * Strips the asterisks from the DocBlock comment. - * - * @param string $comment String containing the comment text. - * - * @return string - */ - protected function cleanInput($comment) - { - $comment = trim( - preg_replace( - '#[ \t]*(?:\/\*\*|\*\/|\*)?[ \t]{0,1}(.*)?#u', - '$1', - $comment - ) - ); - - // reg ex above is not able to remove */ from a single line docblock - if (substr($comment, -2) == '*/') { - $comment = trim(substr($comment, 0, -2)); - } - - // normalize strings - $comment = str_replace(array("\r\n", "\r"), "\n", $comment); - - return $comment; - } - - /** - * Splits the DocBlock into a template marker, summary, description and block of tags. - * - * @param string $comment Comment to split into the sub-parts. - * - * @author Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split. - * @author Mike van Riel for extending the regex with template marker support. - * - * @return string[] containing the template marker (if any), summary, description and a string containing the tags. - */ - protected function splitDocBlock($comment) - { - // Performance improvement cheat: if the first character is an @ then only tags are in this DocBlock. This - // method does not split tags so we return this verbatim as the fourth result (tags). This saves us the - // performance impact of running a regular expression - if (strpos($comment, '@') === 0) { - return array('', '', '', $comment); - } - - // clears all extra horizontal whitespace from the line endings to prevent parsing issues - $comment = preg_replace('/\h*$/Sum', '', $comment); - - /* - * Splits the docblock into a template marker, short description, long description and tags section - * - * - The template marker is empty, #@+ or #@- if the DocBlock starts with either of those (a newline may - * occur after it and will be stripped). - * - The short description is started from the first character until a dot is encountered followed by a - * newline OR two consecutive newlines (horizontal whitespace is taken into account to consider spacing - * errors). This is optional. - * - The long description, any character until a new line is encountered followed by an @ and word - * characters (a tag). This is optional. - * - Tags; the remaining characters - * - * Big thanks to RichardJ for contributing this Regular Expression - */ - preg_match( - '/ - \A - # 1. Extract the template marker - (?:(\#\@\+|\#\@\-)\n?)? - - # 2. Extract the summary - (?: - (?! @\pL ) # The summary may not start with an @ - ( - [^\n.]+ - (?: - (?! \. \n | \n{2} ) # End summary upon a dot followed by newline or two newlines - [\n.] (?! [ \t]* @\pL ) # End summary when an @ is found as first character on a new line - [^\n.]+ # Include anything else - )* - \.? - )? - ) - - # 3. Extract the description - (?: - \s* # Some form of whitespace _must_ precede a description because a summary must be there - (?! @\pL ) # The description may not start with an @ - ( - [^\n]+ - (?: \n+ - (?! [ \t]* @\pL ) # End description when an @ is found as first character on a new line - [^\n]+ # Include anything else - )* - ) - )? - - # 4. Extract the tags (anything that follows) - (\s+ [\s\S]*)? # everything that follows - /ux', - $comment, - $matches - ); - array_shift($matches); - - while (count($matches) < 4) { - $matches[] = ''; - } - - return $matches; - } - - /** - * Creates the tag objects. - * - * @param string $tags Tag block to parse. - * - * @return void - */ - protected function parseTags($tags) - { - $result = array(); - $tags = trim($tags); - if ('' !== $tags) { - if ('@' !== $tags[0]) { - throw new \LogicException( - 'A tag block started with text instead of an actual tag,' - . ' this makes the tag block invalid: ' . $tags - ); - } - foreach (explode("\n", $tags) as $tag_line) { - if (isset($tag_line[0]) && ($tag_line[0] === '@')) { - $result[] = $tag_line; - } else { - $result[count($result) - 1] .= "\n" . $tag_line; - } - } - - // create proper Tag objects - foreach ($result as $key => $tag_line) { - $result[$key] = Tag::createInstance(trim($tag_line), $this); - } - } - - $this->tags = $result; - } - - /** - * Gets the text portion of the doc block. - * - * Gets the text portion (short and long description combined) of the doc - * block. - * - * @return string The text portion of the doc block. - */ - public function getText() - { - $short = $this->getShortDescription(); - $long = $this->getLongDescription()->getContents(); - - if ($long) { - return "{$short}\n\n{$long}"; - } else { - return $short; - } - } - - /** - * Set the text portion of the doc block. - * - * Sets the text portion (short and long description combined) of the doc - * block. - * - * @param string $docblock The new text portion of the doc block. - * - * @return $this This doc block. - */ - public function setText($comment) - { - list(,$short, $long) = $this->splitDocBlock($comment); - $this->short_description = $short; - $this->long_description = new DocBlock\Description($long, $this); - return $this; - } - /** - * Returns the opening line or also known as short description. - * - * @return string - */ - public function getShortDescription() - { - return $this->short_description; - } - - /** - * Returns the full description or also known as long description. - * - * @return DocBlock\Description - */ - public function getLongDescription() - { - return $this->long_description; - } - - /** - * Returns whether this DocBlock is the start of a Template section. - * - * A Docblock may serve as template for a series of subsequent DocBlocks. This is indicated by a special marker - * (`#@+`) that is appended directly after the opening `/**` of a DocBlock. - * - * An example of such an opening is: - * - * ``` - * /**#@+ - * * My DocBlock - * * / - * ``` - * - * The description and tags (not the summary!) are copied onto all subsequent DocBlocks and also applied to all - * elements that follow until another DocBlock is found that contains the closing marker (`#@-`). - * - * @see self::isTemplateEnd() for the check whether a closing marker was provided. - * - * @return boolean - */ - public function isTemplateStart() - { - return $this->isTemplateStart; - } - - /** - * Returns whether this DocBlock is the end of a Template section. - * - * @see self::isTemplateStart() for a more complete description of the Docblock Template functionality. - * - * @return boolean - */ - public function isTemplateEnd() - { - return $this->isTemplateEnd; - } - - /** - * Returns the current context. - * - * @return Context - */ - public function getContext() - { - return $this->context; - } - - /** - * Returns the current location. - * - * @return Location - */ - public function getLocation() - { - return $this->location; - } - - /** - * Returns the tags for this DocBlock. - * - * @return Tag[] - */ - public function getTags() - { - return $this->tags; - } - - /** - * Returns an array of tags matching the given name. If no tags are found - * an empty array is returned. - * - * @param string $name String to search by. - * - * @return Tag[] - */ - public function getTagsByName($name) - { - $result = array(); - - /** @var Tag $tag */ - foreach ($this->getTags() as $tag) { - if ($tag->getName() != $name) { - continue; - } - - $result[] = $tag; - } - - return $result; - } - - /** - * Checks if a tag of a certain type is present in this DocBlock. - * - * @param string $name Tag name to check for. - * - * @return bool - */ - public function hasTag($name) - { - /** @var Tag $tag */ - foreach ($this->getTags() as $tag) { - if ($tag->getName() == $name) { - return true; - } - } - - return false; - } - - /** - * Appends a tag at the end of the list of tags. - * - * @param Tag $tag The tag to add. - * - * @return Tag The newly added tag. - * - * @throws \LogicException When the tag belongs to a different DocBlock. - */ - public function appendTag(Tag $tag) - { - if (null === $tag->getDocBlock()) { - $tag->setDocBlock($this); - } - - if ($tag->getDocBlock() === $this) { - $this->tags[] = $tag; - } else { - throw new \LogicException( - 'This tag belongs to a different DocBlock object.' - ); - } - - return $tag; - } - - - /** - * Builds a string representation of this object. - * - * @todo determine the exact format as used by PHP Reflection and - * implement it. - * - * @return string - * @codeCoverageIgnore Not yet implemented - */ - public static function export() - { - throw new \Exception('Not yet implemented'); - } - - /** - * Returns the exported information (we should use the export static method - * BUT this throws an exception at this point). - * - * @return string - * @codeCoverageIgnore Not yet implemented - */ - public function __toString() - { - return 'Not yet implemented'; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php deleted file mode 100644 index 81aa83ce..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Context.php +++ /dev/null @@ -1,154 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -/** - * The context in which a DocBlock occurs. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Context -{ - /** @var string The current namespace. */ - protected $namespace = ''; - - /** @var array List of namespace aliases => Fully Qualified Namespace. */ - protected $namespace_aliases = array(); - - /** @var string Name of the structural element, within the namespace. */ - protected $lsen = ''; - - /** - * Cteates a new context. - * @param string $namespace The namespace where this DocBlock - * resides in. - * @param array $namespace_aliases List of namespace aliases => Fully - * Qualified Namespace. - * @param string $lsen Name of the structural element, within - * the namespace. - */ - public function __construct( - $namespace = '', - array $namespace_aliases = array(), - $lsen = '' - ) { - if (!empty($namespace)) { - $this->setNamespace($namespace); - } - $this->setNamespaceAliases($namespace_aliases); - $this->setLSEN($lsen); - } - - /** - * @return string The namespace where this DocBlock resides in. - */ - public function getNamespace() - { - return $this->namespace; - } - - /** - * @return array List of namespace aliases => Fully Qualified Namespace. - */ - public function getNamespaceAliases() - { - return $this->namespace_aliases; - } - - /** - * Returns the Local Structural Element Name. - * - * @return string Name of the structural element, within the namespace. - */ - public function getLSEN() - { - return $this->lsen; - } - - /** - * Sets a new namespace. - * - * Sets a new namespace for the context. Leading and trailing slashes are - * trimmed, and the keywords "global" and "default" are treated as aliases - * to no namespace. - * - * @param string $namespace The new namespace to set. - * - * @return $this - */ - public function setNamespace($namespace) - { - if ('global' !== $namespace - && 'default' !== $namespace - ) { - // Srip leading and trailing slash - $this->namespace = trim((string)$namespace, '\\'); - } else { - $this->namespace = ''; - } - return $this; - } - - /** - * Sets the namespace aliases, replacing all previous ones. - * - * @param array $namespace_aliases List of namespace aliases => Fully - * Qualified Namespace. - * - * @return $this - */ - public function setNamespaceAliases(array $namespace_aliases) - { - $this->namespace_aliases = array(); - foreach ($namespace_aliases as $alias => $fqnn) { - $this->setNamespaceAlias($alias, $fqnn); - } - return $this; - } - - /** - * Adds a namespace alias to the context. - * - * @param string $alias The alias name (the part after "as", or the last - * part of the Fully Qualified Namespace Name) to add. - * @param string $fqnn The Fully Qualified Namespace Name for this alias. - * Any form of leading/trailing slashes are accepted, but what will be - * stored is a name, prefixed with a slash, and no trailing slash. - * - * @return $this - */ - public function setNamespaceAlias($alias, $fqnn) - { - $this->namespace_aliases[$alias] = '\\' . trim((string)$fqnn, '\\'); - return $this; - } - - /** - * Sets a new Local Structural Element Name. - * - * Sets a new Local Structural Element Name. A local name also contains - * punctuation determining the kind of structural element (e.g. trailing "(" - * and ")" for functions and methods). - * - * @param string $lsen The new local name of a structural element. - * - * @return $this - */ - public function setLSEN($lsen) - { - $this->lsen = (string)$lsen; - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php deleted file mode 100644 index d41142e2..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Description.php +++ /dev/null @@ -1,223 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -use phpDocumentor\Reflection\DocBlock; - -/** - * Parses a Description of a DocBlock or tag. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Description implements \Reflector -{ - /** @var string */ - protected $contents = ''; - - /** @var array The contents, as an array of strings and Tag objects. */ - protected $parsedContents = null; - - /** @var DocBlock The DocBlock which this description belongs to. */ - protected $docblock = null; - - /** - * Populates the fields of a description. - * - * @param string $content The description's conetnts. - * @param DocBlock $docblock The DocBlock which this description belongs to. - */ - public function __construct($content, DocBlock $docblock = null) - { - $this->setContent($content)->setDocBlock($docblock); - } - - /** - * Gets the text of this description. - * - * @return string - */ - public function getContents() - { - return $this->contents; - } - - /** - * Sets the text of this description. - * - * @param string $content The new text of this description. - * - * @return $this - */ - public function setContent($content) - { - $this->contents = trim($content); - - $this->parsedContents = null; - return $this; - } - - /** - * Returns the parsed text of this description. - * - * @return array An array of strings and tag objects, in the order they - * occur within the description. - */ - public function getParsedContents() - { - if (null === $this->parsedContents) { - $this->parsedContents = preg_split( - '/\{ - # "{@}" is not a valid inline tag. This ensures that - # we do not treat it as one, but treat it literally. - (?!@\}) - # We want to capture the whole tag line, but without the - # inline tag delimiters. - (\@ - # Match everything up to the next delimiter. - [^{}]* - # Nested inline tag content should not be captured, or - # it will appear in the result separately. - (?: - # Match nested inline tags. - (?: - # Because we did not catch the tag delimiters - # earlier, we must be explicit with them here. - # Notice that this also matches "{}", as a way - # to later introduce it as an escape sequence. - \{(?1)?\} - | - # Make sure we match hanging "{". - \{ - ) - # Match content after the nested inline tag. - [^{}]* - )* # If there are more inline tags, match them as well. - # We use "*" since there may not be any nested inline - # tags. - ) - \}/Sux', - $this->contents, - null, - PREG_SPLIT_DELIM_CAPTURE - ); - - $count = count($this->parsedContents); - for ($i=1; $i<$count; $i += 2) { - $this->parsedContents[$i] = Tag::createInstance( - $this->parsedContents[$i], - $this->docblock - ); - } - - //In order to allow "literal" inline tags, the otherwise invalid - //sequence "{@}" is changed to "@", and "{}" is changed to "}". - //See unit tests for examples. - for ($i=0; $i<$count; $i += 2) { - $this->parsedContents[$i] = str_replace( - array('{@}', '{}'), - array('@', '}'), - $this->parsedContents[$i] - ); - } - } - return $this->parsedContents; - } - - /** - * Return a formatted variant of the Long Description using MarkDown. - * - * @todo this should become a more intelligent piece of code where the - * configuration contains a setting what format long descriptions are. - * - * @codeCoverageIgnore Will be removed soon, in favor of adapters at - * PhpDocumentor itself that will process text in various formats. - * - * @return string - */ - public function getFormattedContents() - { - $result = $this->contents; - - // if the long description contains a plain HTML element, surround - // it with a pre element. Please note that we explicitly used str_replace - // and not preg_replace to gain performance - if (strpos($result, '') !== false) { - $result = str_replace( - array('', "\r\n", "\n", "\r", ''), - array('
    ', '', '', '', '
    '), - $result - ); - } - - if (class_exists('Parsedown')) { - $markdown = \Parsedown::instance(); - $result = $markdown->parse($result); - } elseif (class_exists('dflydev\markdown\MarkdownExtraParser')) { - $markdown = new \dflydev\markdown\MarkdownExtraParser(); - $result = $markdown->transformMarkdown($result); - } - - return trim($result); - } - - /** - * Gets the docblock this tag belongs to. - * - * @return DocBlock The docblock this description belongs to. - */ - public function getDocBlock() - { - return $this->docblock; - } - - /** - * Sets the docblock this tag belongs to. - * - * @param DocBlock $docblock The new docblock this description belongs to. - * Setting NULL removes any association. - * - * @return $this - */ - public function setDocBlock(DocBlock $docblock = null) - { - $this->docblock = $docblock; - - return $this; - } - - /** - * Builds a string representation of this object. - * - * @todo determine the exact format as used by PHP Reflection - * and implement it. - * - * @return void - * @codeCoverageIgnore Not yet implemented - */ - public static function export() - { - throw new \Exception('Not yet implemented'); - } - - /** - * Returns the long description as a string. - * - * @return string - */ - public function __toString() - { - return $this->getContents(); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php deleted file mode 100644 index 966ed44d..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Location.php +++ /dev/null @@ -1,76 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -/** - * The location a DocBlock occurs within a file. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Location -{ - /** @var int Line where the DocBlock text starts. */ - protected $lineNumber = 0; - - /** @var int Column where the DocBlock text starts. */ - protected $columnNumber = 0; - - public function __construct( - $lineNumber = 0, - $columnNumber = 0 - ) { - $this->setLineNumber($lineNumber)->setColumnNumber($columnNumber); - } - - /** - * @return int Line where the DocBlock text starts. - */ - public function getLineNumber() - { - return $this->lineNumber; - } - - /** - * - * @param type $lineNumber - * @return $this - */ - public function setLineNumber($lineNumber) - { - $this->lineNumber = (int)$lineNumber; - - return $this; - } - - /** - * @return int Column where the DocBlock text starts. - */ - public function getColumnNumber() - { - return $this->columnNumber; - } - - /** - * - * @param int $columnNumber - * @return $this - */ - public function setColumnNumber($columnNumber) - { - $this->columnNumber = (int)$columnNumber; - - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php deleted file mode 100644 index c1617850..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Serializer.php +++ /dev/null @@ -1,198 +0,0 @@ - - * @copyright 2013 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -use phpDocumentor\Reflection\DocBlock; - -/** - * Serializes a DocBlock instance. - * - * @author Barry vd. Heuvel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Serializer -{ - - /** @var string The string to indent the comment with. */ - protected $indentString = ' '; - - /** @var int The number of times the indent string is repeated. */ - protected $indent = 0; - - /** @var bool Whether to indent the first line. */ - protected $isFirstLineIndented = true; - - /** @var int|null The max length of a line. */ - protected $lineLength = null; - - /** - * Create a Serializer instance. - * - * @param int $indent The number of times the indent string is - * repeated. - * @param string $indentString The string to indent the comment with. - * @param bool $indentFirstLine Whether to indent the first line. - * @param int|null $lineLength The max length of a line or NULL to - * disable line wrapping. - */ - public function __construct( - $indent = 0, - $indentString = ' ', - $indentFirstLine = true, - $lineLength = null - ) { - $this->setIndentationString($indentString); - $this->setIndent($indent); - $this->setIsFirstLineIndented($indentFirstLine); - $this->setLineLength($lineLength); - } - - /** - * Sets the string to indent comments with. - * - * @param string $indentationString The string to indent comments with. - * - * @return $this This serializer object. - */ - public function setIndentationString($indentString) - { - $this->indentString = (string)$indentString; - return $this; - } - - /** - * Gets the string to indent comments with. - * - * @return string The indent string. - */ - public function getIndentationString() - { - return $this->indentString; - } - - /** - * Sets the number of indents. - * - * @param int $indent The number of times the indent string is repeated. - * - * @return $this This serializer object. - */ - public function setIndent($indent) - { - $this->indent = (int)$indent; - return $this; - } - - /** - * Gets the number of indents. - * - * @return int The number of times the indent string is repeated. - */ - public function getIndent() - { - return $this->indent; - } - - /** - * Sets whether or not the first line should be indented. - * - * Sets whether or not the first line (the one with the "/**") should be - * indented. - * - * @param bool $indentFirstLine The new value for this setting. - * - * @return $this This serializer object. - */ - public function setIsFirstLineIndented($indentFirstLine) - { - $this->isFirstLineIndented = (bool)$indentFirstLine; - return $this; - } - - /** - * Gets whether or not the first line should be indented. - * - * @return bool Whether or not the first line should be indented. - */ - public function isFirstLineIndented() - { - return $this->isFirstLineIndented; - } - - /** - * Sets the line length. - * - * Sets the length of each line in the serialization. Content will be - * wrapped within this limit. - * - * @param int|null $lineLength The length of each line. NULL to disable line - * wrapping altogether. - * - * @return $this This serializer object. - */ - public function setLineLength($lineLength) - { - $this->lineLength = null === $lineLength ? null : (int)$lineLength; - return $this; - } - - /** - * Gets the line length. - * - * @return int|null The length of each line or NULL if line wrapping is - * disabled. - */ - public function getLineLength() - { - return $this->lineLength; - } - - /** - * Generate a DocBlock comment. - * - * @param DocBlock The DocBlock to serialize. - * - * @return string The serialized doc block. - */ - public function getDocComment(DocBlock $docblock) - { - $indent = str_repeat($this->indentString, $this->indent); - $firstIndent = $this->isFirstLineIndented ? $indent : ''; - - $text = $docblock->getText(); - if ($this->lineLength) { - //3 === strlen(' * ') - $wrapLength = $this->lineLength - strlen($indent) - 3; - $text = wordwrap($text, $wrapLength); - } - $text = str_replace("\n", "\n{$indent} * ", $text); - - $comment = "{$firstIndent}/**\n{$indent} * {$text}\n{$indent} *\n"; - - /** @var Tag $tag */ - foreach ($docblock->getTags() as $tag) { - $tagText = (string) $tag; - if ($this->lineLength) { - $tagText = wordwrap($tagText, $wrapLength); - } - $tagText = str_replace("\n", "\n{$indent} * ", $tagText); - - $comment .= "{$indent} * {$tagText}\n"; - } - - $comment .= $indent . ' */'; - - return $comment; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php deleted file mode 100644 index a96db095..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag.php +++ /dev/null @@ -1,377 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -use phpDocumentor\Reflection\DocBlock; - -/** - * Parses a tag definition for a DocBlock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Tag implements \Reflector -{ - /** - * PCRE regular expression matching a tag name. - */ - const REGEX_TAGNAME = '[\w\-\_\\\\]+'; - - /** @var string Name of the tag */ - protected $tag = ''; - - /** - * @var string|null Content of the tag. - * When set to NULL, it means it needs to be regenerated. - */ - protected $content = ''; - - /** @var string Description of the content of this tag */ - protected $description = ''; - - /** - * @var array|null The description, as an array of strings and Tag objects. - * When set to NULL, it means it needs to be regenerated. - */ - protected $parsedDescription = null; - - /** @var Location Location of the tag. */ - protected $location = null; - - /** @var DocBlock The DocBlock which this tag belongs to. */ - protected $docblock = null; - - /** - * @var array An array with a tag as a key, and an FQCN to a class that - * handles it as an array value. The class is expected to inherit this - * class. - */ - private static $tagHandlerMappings = array( - 'author' - => '\phpDocumentor\Reflection\DocBlock\Tag\AuthorTag', - 'covers' - => '\phpDocumentor\Reflection\DocBlock\Tag\CoversTag', - 'deprecated' - => '\phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag', - 'example' - => '\phpDocumentor\Reflection\DocBlock\Tag\ExampleTag', - 'link' - => '\phpDocumentor\Reflection\DocBlock\Tag\LinkTag', - 'method' - => '\phpDocumentor\Reflection\DocBlock\Tag\MethodTag', - 'param' - => '\phpDocumentor\Reflection\DocBlock\Tag\ParamTag', - 'property-read' - => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyReadTag', - 'property' - => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyTag', - 'property-write' - => '\phpDocumentor\Reflection\DocBlock\Tag\PropertyWriteTag', - 'return' - => '\phpDocumentor\Reflection\DocBlock\Tag\ReturnTag', - 'see' - => '\phpDocumentor\Reflection\DocBlock\Tag\SeeTag', - 'since' - => '\phpDocumentor\Reflection\DocBlock\Tag\SinceTag', - 'source' - => '\phpDocumentor\Reflection\DocBlock\Tag\SourceTag', - 'throw' - => '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag', - 'throws' - => '\phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag', - 'uses' - => '\phpDocumentor\Reflection\DocBlock\Tag\UsesTag', - 'var' - => '\phpDocumentor\Reflection\DocBlock\Tag\VarTag', - 'version' - => '\phpDocumentor\Reflection\DocBlock\Tag\VersionTag' - ); - - /** - * Factory method responsible for instantiating the correct sub type. - * - * @param string $tag_line The text for this tag, including description. - * @param DocBlock $docblock The DocBlock which this tag belongs to. - * @param Location $location Location of the tag. - * - * @throws \InvalidArgumentException if an invalid tag line was presented. - * - * @return static A new tag object. - */ - final public static function createInstance( - $tag_line, - DocBlock $docblock = null, - Location $location = null - ) { - if (!preg_match( - '/^@(' . self::REGEX_TAGNAME . ')(?:\s*([^\s].*)|$)?/us', - $tag_line, - $matches - )) { - throw new \InvalidArgumentException( - 'Invalid tag_line detected: ' . $tag_line - ); - } - - $handler = __CLASS__; - if (isset(self::$tagHandlerMappings[$matches[1]])) { - $handler = self::$tagHandlerMappings[$matches[1]]; - } elseif (isset($docblock)) { - $tagName = (string)new Type\Collection( - array($matches[1]), - $docblock->getContext() - ); - - if (isset(self::$tagHandlerMappings[$tagName])) { - $handler = self::$tagHandlerMappings[$tagName]; - } - } - - return new $handler( - $matches[1], - isset($matches[2]) ? $matches[2] : '', - $docblock, - $location - ); - } - - /** - * Registers a handler for tags. - * - * Registers a handler for tags. The class specified is autoloaded if it's - * not available. It must inherit from this class. - * - * @param string $tag Name of tag to regiser a handler for. When - * registering a namespaced tag, the full name, along with a prefixing - * slash MUST be provided. - * @param string|null $handler FQCN of handler. Specifing NULL removes the - * handler for the specified tag, if any. - * - * @return bool TRUE on success, FALSE on failure. - */ - final public static function registerTagHandler($tag, $handler) - { - $tag = trim((string)$tag); - - if (null === $handler) { - unset(self::$tagHandlerMappings[$tag]); - return true; - } - - if ('' !== $tag - && class_exists($handler, true) - && is_subclass_of($handler, __CLASS__) - && !strpos($tag, '\\') //Accept no slash, and 1st slash at offset 0. - ) { - self::$tagHandlerMappings[$tag] = $handler; - return true; - } - - return false; - } - - /** - * Parses a tag and populates the member variables. - * - * @param string $name Name of the tag. - * @param string $content The contents of the given tag. - * @param DocBlock $docblock The DocBlock which this tag belongs to. - * @param Location $location Location of the tag. - */ - public function __construct( - $name, - $content, - DocBlock $docblock = null, - Location $location = null - ) { - $this - ->setName($name) - ->setContent($content) - ->setDocBlock($docblock) - ->setLocation($location); - } - - /** - * Gets the name of this tag. - * - * @return string The name of this tag. - */ - public function getName() - { - return $this->tag; - } - - /** - * Sets the name of this tag. - * - * @param string $name The new name of this tag. - * - * @return $this - * @throws \InvalidArgumentException When an invalid tag name is provided. - */ - public function setName($name) - { - if (!preg_match('/^' . self::REGEX_TAGNAME . '$/u', $name)) { - throw new \InvalidArgumentException( - 'Invalid tag name supplied: ' . $name - ); - } - - $this->tag = $name; - - return $this; - } - - /** - * Gets the content of this tag. - * - * @return string - */ - public function getContent() - { - if (null === $this->content) { - $this->content = $this->description; - } - - return $this->content; - } - - /** - * Sets the content of this tag. - * - * @param string $content The new content of this tag. - * - * @return $this - */ - public function setContent($content) - { - $this->setDescription($content); - $this->content = $content; - - return $this; - } - - /** - * Gets the description component of this tag. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the description component of this tag. - * - * @param string $description The new description component of this tag. - * - * @return $this - */ - public function setDescription($description) - { - $this->content = null; - $this->parsedDescription = null; - $this->description = trim($description); - - return $this; - } - - /** - * Gets the parsed text of this description. - * - * @return array An array of strings and tag objects, in the order they - * occur within the description. - */ - public function getParsedDescription() - { - if (null === $this->parsedDescription) { - $description = new Description($this->description, $this->docblock); - $this->parsedDescription = $description->getParsedContents(); - } - return $this->parsedDescription; - } - - /** - * Gets the docblock this tag belongs to. - * - * @return DocBlock The docblock this tag belongs to. - */ - public function getDocBlock() - { - return $this->docblock; - } - - /** - * Sets the docblock this tag belongs to. - * - * @param DocBlock $docblock The new docblock this tag belongs to. Setting - * NULL removes any association. - * - * @return $this - */ - public function setDocBlock(DocBlock $docblock = null) - { - $this->docblock = $docblock; - - return $this; - } - - /** - * Gets the location of the tag. - * - * @return Location The tag's location. - */ - public function getLocation() - { - return $this->location; - } - - /** - * Sets the location of the tag. - * - * @param Location $location The new location of the tag. - * - * @return $this - */ - public function setLocation(Location $location = null) - { - $this->location = $location; - - return $this; - } - - /** - * Builds a string representation of this object. - * - * @todo determine the exact format as used by PHP Reflection and implement it. - * - * @return void - * @codeCoverageIgnore Not yet implemented - */ - public static function export() - { - throw new \Exception('Not yet implemented'); - } - - /** - * Returns the tag as a serialized string - * - * @return string - */ - public function __toString() - { - return "@{$this->getName()} {$this->getContent()}"; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php deleted file mode 100644 index bacf52eb..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/AuthorTag.php +++ /dev/null @@ -1,131 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for an @author tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class AuthorTag extends Tag -{ - /** - * PCRE regular expression matching any valid value for the name component. - */ - const REGEX_AUTHOR_NAME = '[^\<]*'; - - /** - * PCRE regular expression matching any valid value for the email component. - */ - const REGEX_AUTHOR_EMAIL = '[^\>]*'; - - /** @var string The name of the author */ - protected $authorName = ''; - - /** @var string The email of the author */ - protected $authorEmail = ''; - - public function getContent() - { - if (null === $this->content) { - $this->content = $this->authorName; - if ('' != $this->authorEmail) { - $this->content .= "<{$this->authorEmail}>"; - } - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - if (preg_match( - '/^(' . self::REGEX_AUTHOR_NAME . - ')(\<(' . self::REGEX_AUTHOR_EMAIL . - ')\>)?$/u', - $this->description, - $matches - )) { - $this->authorName = trim($matches[1]); - if (isset($matches[3])) { - $this->authorEmail = trim($matches[3]); - } - } - - return $this; - } - - /** - * Gets the author's name. - * - * @return string The author's name. - */ - public function getAuthorName() - { - return $this->authorName; - } - - /** - * Sets the author's name. - * - * @param string $authorName The new author name. - * An invalid value will set an empty string. - * - * @return $this - */ - public function setAuthorName($authorName) - { - $this->content = null; - $this->authorName - = preg_match('/^' . self::REGEX_AUTHOR_NAME . '$/u', $authorName) - ? $authorName : ''; - - return $this; - } - - /** - * Gets the author's email. - * - * @return string The author's email. - */ - public function getAuthorEmail() - { - return $this->authorEmail; - } - - /** - * Sets the author's email. - * - * @param string $authorEmail The new author email. - * An invalid value will set an empty string. - * - * @return $this - */ - public function setAuthorEmail($authorEmail) - { - $this->authorEmail - = preg_match('/^' . self::REGEX_AUTHOR_EMAIL . '$/u', $authorEmail) - ? $authorEmail : ''; - - $this->content = null; - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php deleted file mode 100644 index bd31b56b..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/CoversTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @covers tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class CoversTag extends SeeTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php deleted file mode 100644 index 7226316b..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTag.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag\VersionTag; - -/** - * Reflection class for a @deprecated tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DeprecatedTag extends VersionTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php deleted file mode 100644 index 0e163ea0..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ExampleTag.php +++ /dev/null @@ -1,156 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @example tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ExampleTag extends SourceTag -{ - /** - * @var string Path to a file to use as an example. - * May also be an absolute URI. - */ - protected $filePath = ''; - - /** - * @var bool Whether the file path component represents an URI. - * This determines how the file portion appears at {@link getContent()}. - */ - protected $isURI = false; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $filePath = ''; - if ($this->isURI) { - if (false === strpos($this->filePath, ':')) { - $filePath = str_replace( - '%2F', - '/', - rawurlencode($this->filePath) - ); - } else { - $filePath = $this->filePath; - } - } else { - $filePath = '"' . $this->filePath . '"'; - } - - $this->content = $filePath . ' ' . parent::getContent(); - } - - return $this->content; - } - /** - * {@inheritdoc} - */ - public function setContent($content) - { - Tag::setContent($content); - if (preg_match( - '/^ - # File component - (?: - # File path in quotes - \"([^\"]+)\" - | - # File URI - (\S+) - ) - # Remaining content (parsed by SourceTag) - (?:\s+(.*))? - $/sux', - $this->description, - $matches - )) { - if ('' !== $matches[1]) { - $this->setFilePath($matches[1]); - } else { - $this->setFileURI($matches[2]); - } - - if (isset($matches[3])) { - parent::setContent($matches[3]); - } else { - $this->setDescription(''); - } - $this->content = $content; - } - - return $this; - } - - /** - * Returns the file path. - * - * @return string Path to a file to use as an example. - * May also be an absolute URI. - */ - public function getFilePath() - { - return $this->filePath; - } - - /** - * Sets the file path. - * - * @param string $filePath The new file path to use for the example. - * - * @return $this - */ - public function setFilePath($filePath) - { - $this->isURI = false; - $this->filePath = trim($filePath); - - $this->content = null; - return $this; - } - - /** - * Sets the file path as an URI. - * - * This function is equivalent to {@link setFilePath()}, except that it - * convers an URI to a file path before that. - * - * There is no getFileURI(), as {@link getFilePath()} is compatible. - * - * @param type $uri The new file URI to use as an example. - */ - public function setFileURI($uri) - { - $this->isURI = true; - if (false === strpos($uri, ':')) { - //Relative URL - $this->filePath = rawurldecode( - str_replace(array('/', '\\'), '%2F', $uri) - ); - } else { - //Absolute URL or URI. - $this->filePath = $uri; - } - - $this->content = null; - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php deleted file mode 100644 index f79f25dd..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/LinkTag.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @link tag in a Docblock. - * - * @author Ben Selby - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class LinkTag extends Tag -{ - /** @var string */ - protected $link = ''; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content = "{$this->link} {$this->description}"; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - $parts = preg_split('/\s+/Su', $this->description, 2); - - $this->link = $parts[0]; - - $this->setDescription(isset($parts[1]) ? $parts[1] : $parts[0]); - - $this->content = $content; - return $this; - } - - /** - * Gets the link - * - * @return string - */ - public function getLink() - { - return $this->link; - } - - /** - * Sets the link - * - * @param string $link The link - * - * @return $this - */ - public function setLink($link) - { - $this->link = $link; - - $this->content = null; - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php deleted file mode 100644 index 7a5ce790..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/MethodTag.php +++ /dev/null @@ -1,209 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @method in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class MethodTag extends ReturnTag -{ - - /** @var string */ - protected $method_name = ''; - - /** @var string */ - protected $arguments = ''; - - /** @var bool */ - protected $isStatic = false; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content = ''; - if ($this->isStatic) { - $this->content .= 'static '; - } - $this->content .= $this->type . - " {$this->method_name}({$this->arguments}) " . - $this->description; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - Tag::setContent($content); - // 1. none or more whitespace - // 2. optionally the keyword "static" followed by whitespace - // 3. optionally a word with underscores followed by whitespace : as - // type for the return value - // 4. then optionally a word with underscores followed by () and - // whitespace : as method name as used by phpDocumentor - // 5. then a word with underscores, followed by ( and any character - // until a ) and whitespace : as method name with signature - // 6. any remaining text : as description - if (preg_match( - '/^ - # Static keyword - # Declates a static method ONLY if type is also present - (?: - (static) - \s+ - )? - # Return type - (?: - ([\w\|_\\\\]+) - \s+ - )? - # Legacy method name (not captured) - (?: - [\w_]+\(\)\s+ - )? - # Method name - ([\w\|_\\\\]+) - # Arguments - \(([^\)]*)\) - \s* - # Description - (.*) - $/sux', - $this->description, - $matches - )) { - list( - , - $static, - $this->type, - $this->method_name, - $this->arguments, - $this->description - ) = $matches; - if ($static) { - if (!$this->type) { - $this->type = 'static'; - } else { - $this->isStatic = true; - } - } else { - if (!$this->type) { - $this->type = 'void'; - } - } - $this->parsedDescription = null; - } - - return $this; - } - - /** - * Sets the name of this method. - * - * @param string $method_name The name of the method. - * - * @return $this - */ - public function setMethodName($method_name) - { - $this->method_name = $method_name; - - $this->content = null; - return $this; - } - - /** - * Retrieves the method name. - * - * @return string - */ - public function getMethodName() - { - return $this->method_name; - } - - /** - * Sets the arguments for this method. - * - * @param string $arguments A comma-separated arguments line. - * - * @return void - */ - public function setArguments($arguments) - { - $this->arguments = $arguments; - - $this->content = null; - return $this; - } - - /** - * Returns an array containing each argument as array of type and name. - * - * Please note that the argument sub-array may only contain 1 element if no - * type was specified. - * - * @return string[] - */ - public function getArguments() - { - if (empty($this->arguments)) { - return array(); - } - - $arguments = explode(',', $this->arguments); - foreach ($arguments as $key => $value) { - $arguments[$key] = explode(' ', trim($value)); - } - - return $arguments; - } - - /** - * Checks whether the method tag describes a static method or not. - * - * @return bool TRUE if the method declaration is for a static method, FALSE - * otherwise. - */ - public function isStatic() - { - return $this->isStatic; - } - - /** - * Sets a new value for whether the method is static or not. - * - * @param bool $isStatic The new value to set. - * - * @return $this - */ - public function setIsStatic($isStatic) - { - $this->isStatic = $isStatic; - - $this->content = null; - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php deleted file mode 100644 index 9bc0270d..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ParamTag.php +++ /dev/null @@ -1,119 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @param tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ParamTag extends ReturnTag -{ - /** @var string */ - protected $variableName = ''; - - /** @var bool determines whether this is a variadic argument */ - protected $isVariadic = false; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content - = "{$this->type} {$this->variableName} {$this->description}"; - } - return $this->content; - } - /** - * {@inheritdoc} - */ - public function setContent($content) - { - Tag::setContent($content); - $parts = preg_split( - '/(\s+)/Su', - $this->description, - 3, - PREG_SPLIT_DELIM_CAPTURE - ); - - // if the first item that is encountered is not a variable; it is a type - if (isset($parts[0]) - && (strlen($parts[0]) > 0) - && ($parts[0][0] !== '$') - ) { - $this->type = array_shift($parts); - array_shift($parts); - } - - // if the next item starts with a $ or ...$ it must be the variable name - if (isset($parts[0]) - && (strlen($parts[0]) > 0) - && ($parts[0][0] == '$' || substr($parts[0], 0, 4) === '...$') - ) { - $this->variableName = array_shift($parts); - array_shift($parts); - - if (substr($this->variableName, 0, 3) === '...') { - $this->isVariadic = true; - $this->variableName = substr($this->variableName, 3); - } - } - - $this->setDescription(implode('', $parts)); - - $this->content = $content; - return $this; - } - - /** - * Returns the variable's name. - * - * @return string - */ - public function getVariableName() - { - return $this->variableName; - } - - /** - * Sets the variable's name. - * - * @param string $name The new name for this variable. - * - * @return $this - */ - public function setVariableName($name) - { - $this->variableName = $name; - - $this->content = null; - return $this; - } - - /** - * Returns whether this tag is variadic. - * - * @return boolean - */ - public function isVariadic() - { - return $this->isVariadic; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php deleted file mode 100644 index 33406026..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyReadTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @property-read tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class PropertyReadTag extends PropertyTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php deleted file mode 100644 index 288ecff8..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @property tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class PropertyTag extends ParamTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php deleted file mode 100644 index ec4e866d..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/PropertyWriteTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @property-write tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class PropertyWriteTag extends PropertyTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php deleted file mode 100644 index 9293db92..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ReturnTag.php +++ /dev/null @@ -1,99 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; -use phpDocumentor\Reflection\DocBlock\Type\Collection; - -/** - * Reflection class for a @return tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ReturnTag extends Tag -{ - /** @var string The raw type component. */ - protected $type = ''; - - /** @var Collection The parsed type component. */ - protected $types = null; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content = "{$this->type} {$this->description}"; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - - $parts = preg_split('/\s+/Su', $this->description, 2); - - // any output is considered a type - $this->type = $parts[0]; - $this->types = null; - - $this->setDescription(isset($parts[1]) ? $parts[1] : ''); - - $this->content = $content; - return $this; - } - - /** - * Returns the unique types of the variable. - * - * @return string[] - */ - public function getTypes() - { - return $this->getTypesCollection()->getArrayCopy(); - } - - /** - * Returns the type section of the variable. - * - * @return string - */ - public function getType() - { - return (string) $this->getTypesCollection(); - } - - /** - * Returns the type collection. - * - * @return void - */ - protected function getTypesCollection() - { - if (null === $this->types) { - $this->types = new Collection( - array($this->type), - $this->docblock ? $this->docblock->getContext() : null - ); - } - return $this->types; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php deleted file mode 100644 index 4f5f22ce..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SeeTag.php +++ /dev/null @@ -1,81 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @see tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SeeTag extends Tag -{ - /** @var string */ - protected $refers = null; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content = "{$this->refers} {$this->description}"; - } - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - $parts = preg_split('/\s+/Su', $this->description, 2); - - // any output is considered a type - $this->refers = $parts[0]; - - $this->setDescription(isset($parts[1]) ? $parts[1] : ''); - - $this->content = $content; - return $this; - } - - /** - * Gets the structural element this tag refers to. - * - * @return string - */ - public function getReference() - { - return $this->refers; - } - - /** - * Sets the structural element this tag refers to. - * - * @param string $refers The new type this tag refers to. - * - * @return $this - */ - public function setReference($refers) - { - $this->refers = $refers; - - $this->content = null; - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php deleted file mode 100644 index ba009c44..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SinceTag.php +++ /dev/null @@ -1,26 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag\VersionTag; - -/** - * Reflection class for a @since tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SinceTag extends VersionTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php deleted file mode 100644 index 3400220e..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/SourceTag.php +++ /dev/null @@ -1,137 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @source tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SourceTag extends Tag -{ - /** - * @var int The starting line, relative to the structural element's - * location. - */ - protected $startingLine = 1; - - /** - * @var int|null The number of lines, relative to the starting line. NULL - * means "to the end". - */ - protected $lineCount = null; - - /** - * {@inheritdoc} - */ - public function getContent() - { - if (null === $this->content) { - $this->content - = "{$this->startingLine} {$this->lineCount} {$this->description}"; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - if (preg_match( - '/^ - # Starting line - ([1-9]\d*) - \s* - # Number of lines - (?: - ((?1)) - \s+ - )? - # Description - (.*) - $/sux', - $this->description, - $matches - )) { - $this->startingLine = (int)$matches[1]; - if (isset($matches[2]) && '' !== $matches[2]) { - $this->lineCount = (int)$matches[2]; - } - $this->setDescription($matches[3]); - $this->content = $content; - } - - return $this; - } - - /** - * Gets the starting line. - * - * @return int The starting line, relative to the structural element's - * location. - */ - public function getStartingLine() - { - return $this->startingLine; - } - - /** - * Sets the starting line. - * - * @param int $startingLine The new starting line, relative to the - * structural element's location. - * - * @return $this - */ - public function setStartingLine($startingLine) - { - $this->startingLine = $startingLine; - - $this->content = null; - return $this; - } - - /** - * Returns the number of lines. - * - * @return int|null The number of lines, relative to the starting line. NULL - * means "to the end". - */ - public function getLineCount() - { - return $this->lineCount; - } - - /** - * Sets the number of lines. - * - * @param int|null $lineCount The new number of lines, relative to the - * starting line. NULL means "to the end". - * - * @return $this - */ - public function setLineCount($lineCount) - { - $this->lineCount = $lineCount; - - $this->content = null; - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php deleted file mode 100644 index 58ee44a4..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @throws tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ThrowsTag extends ReturnTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php deleted file mode 100644 index da0d6638..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/UsesTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @uses tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class UsesTag extends SeeTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php deleted file mode 100644 index 236b2c8b..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VarTag.php +++ /dev/null @@ -1,24 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @var tag in a Docblock. - * - * @author Mike van Riel - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class VarTag extends ParamTag -{ -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php deleted file mode 100644 index 260f6984..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Tag/VersionTag.php +++ /dev/null @@ -1,108 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -use phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Reflection class for a @version tag in a Docblock. - * - * @author Vasil Rangelov - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class VersionTag extends Tag -{ - /** - * PCRE regular expression matching a version vector. - * Assumes the "x" modifier. - */ - const REGEX_VECTOR = '(?: - # Normal release vectors. - \d\S* - | - # VCS version vectors. Per PHPCS, they are expected to - # follow the form of the VCS name, followed by ":", followed - # by the version vector itself. - # By convention, popular VCSes like CVS, SVN and GIT use "$" - # around the actual version vector. - [^\s\:]+\:\s*\$[^\$]+\$ - )'; - - /** @var string The version vector. */ - protected $version = ''; - - public function getContent() - { - if (null === $this->content) { - $this->content = "{$this->version} {$this->description}"; - } - - return $this->content; - } - - /** - * {@inheritdoc} - */ - public function setContent($content) - { - parent::setContent($content); - - if (preg_match( - '/^ - # The version vector - (' . self::REGEX_VECTOR . ') - \s* - # The description - (.+)? - $/sux', - $this->description, - $matches - )) { - $this->version = $matches[1]; - $this->setDescription(isset($matches[2]) ? $matches[2] : ''); - $this->content = $content; - } - - return $this; - } - - /** - * Gets the version section of the tag. - * - * @return string The version section of the tag. - */ - public function getVersion() - { - return $this->version; - } - - /** - * Sets the version section of the tag. - * - * @param string $version The new version section of the tag. - * An invalid value will set an empty string. - * - * @return $this - */ - public function setVersion($version) - { - $this->version - = preg_match('/^' . self::REGEX_VECTOR . '$/ux', $version) - ? $version - : ''; - - $this->content = null; - return $this; - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php b/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php deleted file mode 100644 index 90ead3ff..00000000 --- a/vendor/phpdocumentor/reflection-docblock/src/phpDocumentor/Reflection/DocBlock/Type/Collection.php +++ /dev/null @@ -1,221 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Type; - -use phpDocumentor\Reflection\DocBlock\Context; - -/** - * Collection - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class Collection extends \ArrayObject -{ - /** @var string Definition of the OR operator for types */ - const OPERATOR_OR = '|'; - - /** @var string Definition of the ARRAY operator for types */ - const OPERATOR_ARRAY = '[]'; - - /** @var string Definition of the NAMESPACE operator in PHP */ - const OPERATOR_NAMESPACE = '\\'; - - /** @var string[] List of recognized keywords */ - protected static $keywords = array( - 'string', 'int', 'integer', 'bool', 'boolean', 'float', 'double', - 'object', 'mixed', 'array', 'resource', 'void', 'null', 'scalar', - 'callback', 'callable', 'false', 'true', 'self', '$this', 'static' - ); - - /** - * Current invoking location. - * - * This is used to prepend to type with a relative location. - * May also be 'default' or 'global', in which case they are ignored. - * - * @var Context - */ - protected $context = null; - - /** - * Registers the namespace and aliases; uses that to add and expand the - * given types. - * - * @param string[] $types Array containing a list of types to add to this - * container. - * @param Context $location The current invoking location. - */ - public function __construct( - array $types = array(), - Context $context = null - ) { - $this->context = null === $context ? new Context() : $context; - - foreach ($types as $type) { - $this->add($type); - } - } - - /** - * Returns the current invoking location. - * - * @return Context - */ - public function getContext() - { - return $this->context; - } - - /** - * Adds a new type to the collection and expands it if it contains a - * relative namespace. - * - * If a class in the type contains a relative namespace than this collection - * will try to expand that into a FQCN. - * - * @param string $type A 'Type' as defined in the phpDocumentor - * documentation. - * - * @throws \InvalidArgumentException if a non-string argument is passed. - * - * @see http://phpdoc.org/docs/latest/for-users/types.html for the - * definition of a type. - * - * @return void - */ - public function add($type) - { - if (!is_string($type)) { - throw new \InvalidArgumentException( - 'A type should be represented by a string, received: ' - .var_export($type, true) - ); - } - - // separate the type by the OR operator - $type_parts = explode(self::OPERATOR_OR, $type); - foreach ($type_parts as $part) { - $expanded_type = $this->expand($part); - if ($expanded_type) { - $this[] = $expanded_type; - } - } - } - - /** - * Returns a string representation of the collection. - * - * @return string The resolved types across the collection, separated with - * {@link self::OPERATOR_OR}. - */ - public function __toString() - { - return implode(self::OPERATOR_OR, $this->getArrayCopy()); - } - - /** - * Analyzes the given type and returns the FQCN variant. - * - * When a type is provided this method checks whether it is not a keyword or - * Fully Qualified Class Name. If so it will use the given namespace and - * aliases to expand the type to a FQCN representation. - * - * This method only works as expected if the namespace and aliases are set; - * no dynamic reflection is being performed here. - * - * @param string $type The relative or absolute type. - * - * @uses getNamespace to determine with what to prefix the type name. - * @uses getNamespaceAliases to check whether the first part of the relative - * type name should not be replaced with another namespace. - * - * @return string - */ - protected function expand($type) - { - $type = trim($type); - if (!$type) { - return ''; - } - - if ($this->isTypeAnArray($type)) { - return $this->expand(substr($type, 0, -2)) . self::OPERATOR_ARRAY; - } - - if ($this->isRelativeType($type) && !$this->isTypeAKeyword($type)) { - $type_parts = explode(self::OPERATOR_NAMESPACE, $type, 2); - - $namespace_aliases = $this->context->getNamespaceAliases(); - // if the first segment is not an alias; prepend namespace name and - // return - if (!isset($namespace_aliases[$type_parts[0]])) { - $namespace = $this->context->getNamespace(); - if ('' !== $namespace) { - $namespace .= self::OPERATOR_NAMESPACE; - } - return self::OPERATOR_NAMESPACE . $namespace . $type; - } - - $type_parts[0] = $namespace_aliases[$type_parts[0]]; - $type = implode(self::OPERATOR_NAMESPACE, $type_parts); - } - - return $type; - } - - /** - * Detects whether the given type represents an array. - * - * @param string $type A relative or absolute type as defined in the - * phpDocumentor documentation. - * - * @return bool - */ - protected function isTypeAnArray($type) - { - return substr($type, -2) === self::OPERATOR_ARRAY; - } - - /** - * Detects whether the given type represents a PHPDoc keyword. - * - * @param string $type A relative or absolute type as defined in the - * phpDocumentor documentation. - * - * @return bool - */ - protected function isTypeAKeyword($type) - { - return in_array(strtolower($type), static::$keywords, true); - } - - /** - * Detects whether the given type represents a relative or absolute path. - * - * This method will detect keywords as being absolute; even though they are - * not preceeded by a namespace separator. - * - * @param string $type A relative or absolute type as defined in the - * phpDocumentor documentation. - * - * @return bool - */ - protected function isRelativeType($type) - { - return ($type[0] !== self::OPERATOR_NAMESPACE) - || $this->isTypeAKeyword($type); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/integration/InterpretingDocBlocksTest.php b/vendor/phpdocumentor/reflection-docblock/tests/integration/InterpretingDocBlocksTest.php new file mode 100644 index 00000000..91b8eb36 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/integration/InterpretingDocBlocksTest.php @@ -0,0 +1,97 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\StandardTagFactory; +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\Tags\See; + +/** + * @coversNothing + */ +class InterpretingDocBlocksTest extends \PHPUnit_Framework_TestCase +{ + public function testInterpretingASimpleDocBlock() + { + /** + * @var DocBlock $docblock + * @var string $summary + * @var Description $description + */ + include(__DIR__ . '/../../examples/01-interpreting-a-simple-docblock.php'); + + $descriptionText = <<assertInstanceOf(DocBlock::class, $docblock); + $this->assertSame('This is an example of a summary.', $summary); + $this->assertInstanceOf(Description::class, $description); + $this->assertSame($descriptionText, $description->render()); + $this->assertEmpty($docblock->getTags()); + } + + public function testInterpretingTags() + { + /** + * @var DocBlock $docblock + * @var boolean $hasSeeTag + * @var Tag[] $tags + * @var See[] $seeTags + */ + include(__DIR__ . '/../../examples/02-interpreting-tags.php'); + + $this->assertTrue($hasSeeTag); + $this->assertCount(1, $tags); + $this->assertCount(1, $seeTags); + + $this->assertInstanceOf(See::class, $tags[0]); + $this->assertInstanceOf(See::class, $seeTags[0]); + + $seeTag = $seeTags[0]; + $this->assertSame('\\' . StandardTagFactory::class, (string)$seeTag->getReference()); + $this->assertSame('', (string)$seeTag->getDescription()); + } + + public function testDescriptionsCanEscapeAtSignsAndClosingBraces() + { + /** + * @var string $docComment + * @var DocBlock $docblock + * @var Description $description + * @var string $receivedDocComment + * @var string $foundDescription + */ + + include(__DIR__ . '/../../examples/playing-with-descriptions/02-escaping.php'); + $this->assertSame(<<<'DESCRIPTION' +You can escape the @-sign by surrounding it with braces, for example: @. And escape a closing brace within an +inline tag by adding an opening brace in front of it like this: }. + +Here are example texts where you can see how they could be used in a real life situation: + + This is a text with an {@internal inline tag where a closing brace (}) is shown}. + Or an {@internal inline tag with a literal {@link} in it}. + +Do note that an {@internal inline tag that has an opening brace ({) does not break out}. +DESCRIPTION + , + $foundDescription + ) + ; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/integration/ReconstitutingADocBlockTest.php b/vendor/phpdocumentor/reflection-docblock/tests/integration/ReconstitutingADocBlockTest.php new file mode 100644 index 00000000..92ac22ed --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/integration/ReconstitutingADocBlockTest.php @@ -0,0 +1,35 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\StandardTagFactory; +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\Tags\See; + +/** + * @coversNothing + */ +class ReconstitutingADocBlockTest extends \PHPUnit_Framework_TestCase +{ + public function testReconstituteADocBlock() + { + /** + * @var string $docComment + * @var string $reconstitutedDocComment + */ + include(__DIR__ . '/../../examples/03-reconstituting-a-docblock.php'); + + $this->assertSame($docComment, $reconstitutedDocComment); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/integration/UsingTagsTest.php b/vendor/phpdocumentor/reflection-docblock/tests/integration/UsingTagsTest.php new file mode 100644 index 00000000..984811b1 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/integration/UsingTagsTest.php @@ -0,0 +1,39 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\StandardTagFactory; +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\Tags\See; + +/** + * @coversNothing + */ +class UsingTagsTest extends \PHPUnit_Framework_TestCase +{ + public function testAddingYourOwnTagUsingAStaticMethodAsFactory() + { + /** + * @var object[] $customTagObjects + * @var string $docComment + * @var string $reconstitutedDocComment + */ + include(__DIR__ . '/../../examples/04-adding-your-own-tag.php'); + + $this->assertInstanceOf(\MyTag::class, $customTagObjects[0]); + $this->assertSame('my-tag', $customTagObjects[0]->getName()); + $this->assertSame('I have a description', (string)$customTagObjects[0]->getDescription()); + $this->assertSame($docComment, $reconstitutedDocComment); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php deleted file mode 100644 index a6ca7b37..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/DescriptionTest.php +++ /dev/null @@ -1,245 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Description - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DescriptionTest extends \PHPUnit_Framework_TestCase -{ - public function testConstruct() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(1, $parsedContents); - $this->assertSame($fixture, $parsedContents[0]); - } - - public function testInlineTagParsing() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - $this->assertSame('This is text for a ', $parsedContents[0]); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag\LinkTag', - $parsedContents[1] - ); - $this->assertSame( - ' that uses inline -tags.', - $parsedContents[2] - ); - } - - public function testInlineTagAtStartParsing() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - - $this->assertSame('', $parsedContents[0]); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag\LinkTag', - $parsedContents[1] - ); - $this->assertSame( - ' is text for a description that uses inline -tags.', - $parsedContents[2] - ); - } - - public function testNestedInlineTagParsing() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - - $this->assertSame( - 'This is text for a description with ', - $parsedContents[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $parsedContents[1] - ); - $this->assertSame('.', $parsedContents[2]); - - $parsedDescription = $parsedContents[1]->getParsedDescription(); - $this->assertCount(3, $parsedDescription); - $this->assertSame("inline tag with\n", $parsedDescription[0]); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag\LinkTag', - $parsedDescription[1] - ); - $this->assertSame(' in it', $parsedDescription[2]); - } - - public function testLiteralOpeningDelimiter() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(1, $parsedContents); - $this->assertSame($fixture, $parsedContents[0]); - } - - public function testNestedLiteralOpeningDelimiter() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - $this->assertSame( - 'This is text for a description containing ', - $parsedContents[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $parsedContents[1] - ); - $this->assertSame('.', $parsedContents[2]); - - $this->assertSame( - array('inline tag that has { that -is literal'), - $parsedContents[1]->getParsedDescription() - ); - } - - public function testLiteralClosingDelimiter() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(1, $parsedContents); - $this->assertSame( - 'This is text for a description with } that is not a tag.', - $parsedContents[0] - ); - } - - public function testNestedLiteralClosingDelimiter() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - $this->assertSame( - 'This is text for a description with ', - $parsedContents[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $parsedContents[1] - ); - $this->assertSame('.', $parsedContents[2]); - - $this->assertSame( - array('inline tag with } that is not an -inline tag'), - $parsedContents[1]->getParsedDescription() - ); - } - - public function testInlineTagEscapingSequence() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(1, $parsedContents); - $this->assertSame( - 'This is text for a description with literal {@link}.', - $parsedContents[0] - ); - } - - public function testNestedInlineTagEscapingSequence() - { - $fixture = <<assertSame($fixture, $object->getContents()); - - $parsedContents = $object->getParsedContents(); - $this->assertCount(3, $parsedContents); - $this->assertSame( - 'This is text for a description with an ', - $parsedContents[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $parsedContents[1] - ); - $this->assertSame('.', $parsedContents[2]); - - $this->assertSame( - array('inline tag with literal -{@link} in it'), - $parsedContents[1]->getParsedDescription() - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php deleted file mode 100644 index ff257aa1..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/CoversTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\CoversTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class CoversTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\CoversTag can create - * a link for the covers doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exReference - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\CoversTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exReference - ) { - $tag = new CoversTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exReference, $tag->getReference()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exReference - return array( - array( - 'covers', - 'Foo::bar()', - 'Foo::bar()', - '', - 'Foo::bar()' - ), - array( - 'covers', - 'Foo::bar() Testing', - 'Foo::bar() Testing', - 'Testing', - 'Foo::bar()', - ), - array( - 'covers', - 'Foo::bar() Testing comments', - 'Foo::bar() Testing comments', - 'Testing comments', - 'Foo::bar()', - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php deleted file mode 100644 index 7a75e79c..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/DeprecatedTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DeprecatedTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create - * a link for the @deprecated doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exDescription - * @param string $exVersion - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\DeprecatedTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exVersion - ) { - $tag = new DeprecatedTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exVersion, $tag->getVersion()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exVersion - return array( - array( - 'deprecated', - '1.0 First release.', - '1.0 First release.', - 'First release.', - '1.0' - ), - array( - 'deprecated', - "1.0\nFirst release.", - "1.0\nFirst release.", - 'First release.', - '1.0' - ), - array( - 'deprecated', - "1.0\nFirst\nrelease.", - "1.0\nFirst\nrelease.", - "First\nrelease.", - '1.0' - ), - array( - 'deprecated', - 'Unfinished release', - 'Unfinished release', - 'Unfinished release', - '' - ), - array( - 'deprecated', - '1.0', - '1.0', - '', - '1.0' - ), - array( - 'deprecated', - 'GIT: $Id$', - 'GIT: $Id$', - '', - 'GIT: $Id$' - ), - array( - 'deprecated', - 'GIT: $Id$ Dev build', - 'GIT: $Id$ Dev build', - 'Dev build', - 'GIT: $Id$' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php deleted file mode 100644 index 519a61b3..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ExampleTagTest.php +++ /dev/null @@ -1,203 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ExampleTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can - * understand the @source DocBlock. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exStartingLine - * @param string $exLineCount - * @param string $exFilepath - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\ExampleTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exStartingLine, - $exLineCount, - $exFilePath - ) { - $tag = new ExampleTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exStartingLine, $tag->getStartingLine()); - $this->assertEquals($exLineCount, $tag->getLineCount()); - $this->assertEquals($exFilePath, $tag->getFilePath()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, - // $content, - // $exContent, - // $exDescription, - // $exStartingLine, - // $exLineCount, - // $exFilePath - return array( - array( - 'example', - 'file.php', - 'file.php', - '', - 1, - null, - 'file.php' - ), - array( - 'example', - 'Testing comments', - 'Testing comments', - 'comments', - 1, - null, - 'Testing' - ), - array( - 'example', - 'file.php 2 Testing', - 'file.php 2 Testing', - 'Testing', - 2, - null, - 'file.php' - ), - array( - 'example', - 'file.php 2 3 Testing comments', - 'file.php 2 3 Testing comments', - 'Testing comments', - 2, - 3, - 'file.php' - ), - array( - 'example', - 'file.php 2 -1 Testing comments', - 'file.php 2 -1 Testing comments', - '-1 Testing comments', - 2, - null, - 'file.php' - ), - array( - 'example', - 'file.php -1 1 Testing comments', - 'file.php -1 1 Testing comments', - '-1 1 Testing comments', - 1, - null, - 'file.php' - ), - array( - 'example', - '"file with spaces.php" Testing comments', - '"file with spaces.php" Testing comments', - 'Testing comments', - 1, - null, - 'file with spaces.php' - ), - array( - 'example', - '"file with spaces.php" 2 Testing comments', - '"file with spaces.php" 2 Testing comments', - 'Testing comments', - 2, - null, - 'file with spaces.php' - ), - array( - 'example', - '"file with spaces.php" 2 3 Testing comments', - '"file with spaces.php" 2 3 Testing comments', - 'Testing comments', - 2, - 3, - 'file with spaces.php' - ), - array( - 'example', - '"file with spaces.php" 2 -3 Testing comments', - '"file with spaces.php" 2 -3 Testing comments', - '-3 Testing comments', - 2, - null, - 'file with spaces.php' - ), - array( - 'example', - '"file with spaces.php" -2 3 Testing comments', - '"file with spaces.php" -2 3 Testing comments', - '-2 3 Testing comments', - 1, - null, - 'file with spaces.php' - ), - array( - 'example', - 'file%20with%20spaces.php Testing comments', - 'file%20with%20spaces.php Testing comments', - 'Testing comments', - 1, - null, - 'file with spaces.php' - ), - array( - 'example', - 'folder/file%20with%20spaces.php Testing comments', - 'folder/file%20with%20spaces.php Testing comments', - 'Testing comments', - 1, - null, - 'folder/file with spaces.php' - ), - array( - 'example', - 'http://example.com/file%20with%20spaces.php Testing comments', - 'http://example.com/file%20with%20spaces.php Testing comments', - 'Testing comments', - 1, - null, - 'http://example.com/file%20with%20spaces.php' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php deleted file mode 100644 index 0c64ed08..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/LinkTagTest.php +++ /dev/null @@ -1,87 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\LinkTag - * - * @author Ben Selby - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class LinkTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create - * a link for the @link doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exDescription - * @param string $exLink - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\LinkTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exLink - ) { - $tag = new LinkTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exLink, $tag->getLink()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exLink - return array( - array( - 'link', - 'http://www.phpdoc.org/', - 'http://www.phpdoc.org/', - 'http://www.phpdoc.org/', - 'http://www.phpdoc.org/' - ), - array( - 'link', - 'http://www.phpdoc.org/ Testing', - 'http://www.phpdoc.org/ Testing', - 'Testing', - 'http://www.phpdoc.org/' - ), - array( - 'link', - 'http://www.phpdoc.org/ Testing comments', - 'http://www.phpdoc.org/ Testing comments', - 'Testing comments', - 'http://www.phpdoc.org/' - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php deleted file mode 100644 index efc3a15b..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/MethodTagTest.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\MethodTag - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class MethodTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * @param string $signature The signature to test. - * @param bool $valid Whether the given signature is expected to - * be valid. - * @param string $expected_name The method name that is expected from this - * signature. - * @param string $expected_return The return type that is expected from this - * signature. - * @param bool $paramCount Number of parameters in the signature. - * @param string $description The short description mentioned in the - * signature. - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\MethodTag - * @dataProvider getTestSignatures - * - * @return void - */ - public function testConstruct( - $signature, - $valid, - $expected_name, - $expected_return, - $expected_isStatic, - $paramCount, - $description - ) { - ob_start(); - $tag = new MethodTag('method', $signature); - $stdout = ob_get_clean(); - - $this->assertSame( - $valid, - empty($stdout), - 'No error should have been output if the signature is valid' - ); - - if (!$valid) { - return; - } - - $this->assertEquals($expected_name, $tag->getMethodName()); - $this->assertEquals($expected_return, $tag->getType()); - $this->assertEquals($description, $tag->getDescription()); - $this->assertEquals($expected_isStatic, $tag->isStatic()); - $this->assertCount($paramCount, $tag->getArguments()); - } - - public function getTestSignatures() - { - return array( - // TODO: Verify this case -// array( -// 'foo', -// false, 'foo', '', false, 0, '' -// ), - array( - 'foo()', - true, 'foo', 'void', false, 0, '' - ), - array( - 'foo() description', - true, 'foo', 'void', false, 0, 'description' - ), - array( - 'int foo()', - true, 'foo', 'int', false, 0, '' - ), - array( - 'int foo() description', - true, 'foo', 'int', false, 0, 'description' - ), - array( - 'int foo($a, $b)', - true, 'foo', 'int', false, 2, '' - ), - array( - 'int foo() foo(int $a, int $b)', - true, 'foo', 'int', false, 2, '' - ), - array( - 'int foo(int $a, int $b)', - true, 'foo', 'int', false, 2, '' - ), - array( - 'null|int foo(int $a, int $b)', - true, 'foo', 'null|int', false, 2, '' - ), - array( - 'int foo(null|int $a, int $b)', - true, 'foo', 'int', false, 2, '' - ), - array( - '\Exception foo() foo(Exception $a, Exception $b)', - true, 'foo', '\Exception', false, 2, '' - ), - array( - 'int foo() foo(Exception $a, Exception $b) description', - true, 'foo', 'int', false, 2, 'description' - ), - array( - 'int foo() foo(\Exception $a, \Exception $b) description', - true, 'foo', 'int', false, 2, 'description' - ), - array( - 'void()', - true, 'void', 'void', false, 0, '' - ), - array( - 'static foo()', - true, 'foo', 'static', false, 0, '' - ), - array( - 'static void foo()', - true, 'foo', 'void', true, 0, '' - ), - array( - 'static static foo()', - true, 'foo', 'static', true, 0, '' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php deleted file mode 100644 index 0e05382f..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ParamTagTest.php +++ /dev/null @@ -1,118 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\ParamTag - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ParamTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ParamTag can - * understand the @param DocBlock. - * - * @param string $type - * @param string $content - * @param string $extractedType - * @param string $extractedTypes - * @param string $extractedVarName - * @param string $extractedDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\ParamTag - * @dataProvider provideDataForConstructor - * - * @return void - */ - public function testConstructorParsesInputsIntoCorrectFields( - $type, - $content, - $extractedType, - $extractedTypes, - $extractedVarName, - $extractedDescription - ) { - $tag = new ParamTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($extractedType, $tag->getType()); - $this->assertEquals($extractedTypes, $tag->getTypes()); - $this->assertEquals($extractedVarName, $tag->getVariableName()); - $this->assertEquals($extractedDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParsesInputsIntoCorrectFields() - * - * @return array - */ - public function provideDataForConstructor() - { - return array( - array('param', 'int', 'int', array('int'), '', ''), - array('param', '$bob', '', array(), '$bob', ''), - array( - 'param', - 'int Number of bobs', - 'int', - array('int'), - '', - 'Number of bobs' - ), - array( - 'param', - 'int $bob', - 'int', - array('int'), - '$bob', - '' - ), - array( - 'param', - 'int $bob Number of bobs', - 'int', - array('int'), - '$bob', - 'Number of bobs' - ), - array( - 'param', - "int Description \n on multiple lines", - 'int', - array('int'), - '', - "Description \n on multiple lines" - ), - array( - 'param', - "int \n\$bob Variable name on a new line", - 'int', - array('int'), - '$bob', - "Variable name on a new line" - ), - array( - 'param', - "\nint \$bob Type on a new line", - 'int', - array('int'), - '$bob', - "Type on a new line" - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php deleted file mode 100644 index 9e2aec0d..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ReturnTagTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\ReturnTag - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ReturnTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag can - * understand the @return DocBlock. - * - * @param string $type - * @param string $content - * @param string $extractedType - * @param string $extractedTypes - * @param string $extractedDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\ReturnTag - * @dataProvider provideDataForConstructor - * - * @return void - */ - public function testConstructorParsesInputsIntoCorrectFields( - $type, - $content, - $extractedType, - $extractedTypes, - $extractedDescription - ) { - $tag = new ReturnTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($extractedType, $tag->getType()); - $this->assertEquals($extractedTypes, $tag->getTypes()); - $this->assertEquals($extractedDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParsesInputsIntoCorrectFields() - * - * @return array - */ - public function provideDataForConstructor() - { - return array( - array('return', '', '', array(), ''), - array('return', 'int', 'int', array('int'), ''), - array( - 'return', - 'int Number of Bobs', - 'int', - array('int'), - 'Number of Bobs' - ), - array( - 'return', - 'int|double Number of Bobs', - 'int|double', - array('int', 'double'), - 'Number of Bobs' - ), - array( - 'return', - "int Number of \n Bobs", - 'int', - array('int'), - "Number of \n Bobs" - ), - array( - 'return', - " int Number of Bobs", - 'int', - array('int'), - "Number of Bobs" - ), - array( - 'return', - "int\nNumber of Bobs", - 'int', - array('int'), - "Number of Bobs" - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php deleted file mode 100644 index 6829b046..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SeeTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SeeTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SeeTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the phpDocumentor_Reflection_DocBlock_Tag_See can create a link - * for the @see doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exReference - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\SeeTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exReference - ) { - $tag = new SeeTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exReference, $tag->getReference()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exReference - return array( - array( - 'see', - 'Foo::bar()', - 'Foo::bar()', - '', - 'Foo::bar()' - ), - array( - 'see', - 'Foo::bar() Testing', - 'Foo::bar() Testing', - 'Testing', - 'Foo::bar()', - ), - array( - 'see', - 'Foo::bar() Testing comments', - 'Foo::bar() Testing comments', - 'Testing comments', - 'Foo::bar()', - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php deleted file mode 100644 index 8caf25d1..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SinceTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SinceTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SinceTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create - * a link for the @since doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exDescription - * @param string $exVersion - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\SinceTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exVersion - ) { - $tag = new SinceTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exVersion, $tag->getVersion()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exVersion - return array( - array( - 'since', - '1.0 First release.', - '1.0 First release.', - 'First release.', - '1.0' - ), - array( - 'since', - "1.0\nFirst release.", - "1.0\nFirst release.", - 'First release.', - '1.0' - ), - array( - 'since', - "1.0\nFirst\nrelease.", - "1.0\nFirst\nrelease.", - "First\nrelease.", - '1.0' - ), - array( - 'since', - 'Unfinished release', - 'Unfinished release', - 'Unfinished release', - '' - ), - array( - 'since', - '1.0', - '1.0', - '', - '1.0' - ), - array( - 'since', - 'GIT: $Id$', - 'GIT: $Id$', - '', - 'GIT: $Id$' - ), - array( - 'since', - 'GIT: $Id$ Dev build', - 'GIT: $Id$ Dev build', - 'Dev build', - 'GIT: $Id$' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php deleted file mode 100644 index 2a40e0aa..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/SourceTagTest.php +++ /dev/null @@ -1,116 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\SourceTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class SourceTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\SourceTag can - * understand the @source DocBlock. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exStartingLine - * @param string $exLineCount - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\SourceTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exStartingLine, - $exLineCount - ) { - $tag = new SourceTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exStartingLine, $tag->getStartingLine()); - $this->assertEquals($exLineCount, $tag->getLineCount()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exStartingLine, $exLineCount - return array( - array( - 'source', - '2', - '2', - '', - 2, - null - ), - array( - 'source', - 'Testing', - 'Testing', - 'Testing', - 1, - null - ), - array( - 'source', - '2 Testing', - '2 Testing', - 'Testing', - 2, - null - ), - array( - 'source', - '2 3 Testing comments', - '2 3 Testing comments', - 'Testing comments', - 2, - 3 - ), - array( - 'source', - '2 -1 Testing comments', - '2 -1 Testing comments', - '-1 Testing comments', - 2, - null - ), - array( - 'source', - '-1 1 Testing comments', - '-1 1 Testing comments', - '-1 1 Testing comments', - 1, - null - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php deleted file mode 100644 index 3c669d55..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/ThrowsTagTest.php +++ /dev/null @@ -1,102 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\ThrowsTag - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class ThrowsTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag can - * understand the @throws DocBlock. - * - * @param string $type - * @param string $content - * @param string $extractedType - * @param string $extractedTypes - * @param string $extractedDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\ThrowsTag - * @dataProvider provideDataForConstructor - * - * @return void - */ - public function testConstructorParsesInputsIntoCorrectFields( - $type, - $content, - $extractedType, - $extractedTypes, - $extractedDescription - ) { - $tag = new ThrowsTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($extractedType, $tag->getType()); - $this->assertEquals($extractedTypes, $tag->getTypes()); - $this->assertEquals($extractedDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParsesInputsIntoCorrectFields() - * - * @return array - */ - public function provideDataForConstructor() - { - return array( - array('throws', '', '', array(), ''), - array('throws', 'int', 'int', array('int'), ''), - array( - 'throws', - 'int Number of Bobs', - 'int', - array('int'), - 'Number of Bobs' - ), - array( - 'throws', - 'int|double Number of Bobs', - 'int|double', - array('int', 'double'), - 'Number of Bobs' - ), - array( - 'throws', - "int Number of \n Bobs", - 'int', - array('int'), - "Number of \n Bobs" - ), - array( - 'throws', - " int Number of Bobs", - 'int', - array('int'), - "Number of Bobs" - ), - array( - 'throws', - "int\nNumber of Bobs", - 'int', - array('int'), - "Number of Bobs" - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php deleted file mode 100644 index 45868d73..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/UsesTagTest.php +++ /dev/null @@ -1,86 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\UsesTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class UsesTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\UsesTag can create - * a link for the @uses doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exReference - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\UsesTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exReference - ) { - $tag = new UsesTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exReference, $tag->getReference()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exReference - return array( - array( - 'uses', - 'Foo::bar()', - 'Foo::bar()', - '', - 'Foo::bar()' - ), - array( - 'uses', - 'Foo::bar() Testing', - 'Foo::bar() Testing', - 'Testing', - 'Foo::bar()', - ), - array( - 'uses', - 'Foo::bar() Testing comments', - 'Foo::bar() Testing comments', - 'Testing comments', - 'Foo::bar()', - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php deleted file mode 100644 index 9ae2aa5f..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VarTagTest.php +++ /dev/null @@ -1,94 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class VarTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can - * understand the @var doc block. - * - * @param string $type - * @param string $content - * @param string $exType - * @param string $exVariable - * @param string $exDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\VarTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exType, - $exVariable, - $exDescription - ) { - $tag = new VarTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exType, $tag->getType()); - $this->assertEquals($exVariable, $tag->getVariableName()); - $this->assertEquals($exDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exType, $exVariable, $exDescription - return array( - array( - 'var', - 'int', - 'int', - '', - '' - ), - array( - 'var', - 'int $bob', - 'int', - '$bob', - '' - ), - array( - 'var', - 'int $bob Number of bobs', - 'int', - '$bob', - 'Number of bobs' - ), - array( - 'var', - '', - '', - '', - '' - ), - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php deleted file mode 100644 index e145386d..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Tag/VersionTagTest.php +++ /dev/null @@ -1,115 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Tag; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VersionTag - * - * @author Vasil Rangelov - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class VersionTagTest extends \PHPUnit_Framework_TestCase -{ - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\LinkTag can create - * a link for the @version doc block. - * - * @param string $type - * @param string $content - * @param string $exContent - * @param string $exDescription - * @param string $exVersion - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag\VersionTag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exContent, - $exDescription, - $exVersion - ) { - $tag = new VersionTag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($exContent, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - $this->assertEquals($exVersion, $tag->getVersion()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exContent, $exDescription, $exVersion - return array( - array( - 'version', - '1.0 First release.', - '1.0 First release.', - 'First release.', - '1.0' - ), - array( - 'version', - "1.0\nFirst release.", - "1.0\nFirst release.", - 'First release.', - '1.0' - ), - array( - 'version', - "1.0\nFirst\nrelease.", - "1.0\nFirst\nrelease.", - "First\nrelease.", - '1.0' - ), - array( - 'version', - 'Unfinished release', - 'Unfinished release', - 'Unfinished release', - '' - ), - array( - 'version', - '1.0', - '1.0', - '', - '1.0' - ), - array( - 'version', - 'GIT: $Id$', - 'GIT: $Id$', - '', - 'GIT: $Id$' - ), - array( - 'version', - 'GIT: $Id$ Dev build', - 'GIT: $Id$ Dev build', - 'Dev build', - 'GIT: $Id$' - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php deleted file mode 100644 index 9e873ecb..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/TagTest.php +++ /dev/null @@ -1,313 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock; - -use phpDocumentor\Reflection\DocBlock; -use phpDocumentor\Reflection\DocBlock\Context; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Tag\VarTag - * - * @author Daniel O'Connor - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class TagTest extends \PHPUnit_Framework_TestCase -{ - - /** - * @expectedException \InvalidArgumentException - * - * @return void - */ - public function testInvalidTagLine() - { - Tag::createInstance('Invalid tag line'); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * - * @return void - */ - public function testTagHandlerUnregistration() - { - $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; - $tagPreUnreg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPreUnreg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreUnreg - ); - - Tag::registerTagHandler('var', null); - - $tagPostUnreg = Tag::createInstance('@var mixed'); - $this->assertNotInstanceOf( - $currentHandler, - $tagPostUnreg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostUnreg - ); - - Tag::registerTagHandler('var', $currentHandler); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * - * @return void - */ - public function testTagHandlerCorrectRegistration() - { - if (0 == ini_get('allow_url_include')) { - $this->markTestSkipped('"data" URIs for includes are required.'); - } - $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; - $tagPreReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPreReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - - include 'data:text/plain;base64,'. base64_encode( -<<assertTrue(Tag::registerTagHandler('var', '\MyTagHandler')); - - $tagPostReg = Tag::createInstance('@var mixed'); - $this->assertNotInstanceOf( - $currentHandler, - $tagPostReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - $this->assertInstanceOf( - '\MyTagHandler', - $tagPostReg - ); - - $this->assertTrue(Tag::registerTagHandler('var', $currentHandler)); - } - - /** - * @depends testTagHandlerCorrectRegistration - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance - * - * @return void - */ - public function testNamespacedTagHandlerCorrectRegistration() - { - $tagPreReg = Tag::createInstance('@T something'); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - $this->assertNotInstanceOf( - '\MyTagHandler', - $tagPreReg - ); - - $this->assertTrue( - Tag::registerTagHandler('\MyNamespace\MyTag', '\MyTagHandler') - ); - - $tagPostReg = Tag::createInstance( - '@T something', - new DocBlock( - '', - new Context('', array('T' => '\MyNamespace\MyTag')) - ) - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - $this->assertInstanceOf( - '\MyTagHandler', - $tagPostReg - ); - - $this->assertTrue( - Tag::registerTagHandler('\MyNamespace\MyTag', null) - ); - } - - /** - * @depends testTagHandlerCorrectRegistration - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * @covers \phpDocumentor\Reflection\DocBlock\Tag::createInstance - * - * @return void - */ - public function testNamespacedTagHandlerIncorrectRegistration() - { - $tagPreReg = Tag::createInstance('@T something'); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - $this->assertNotInstanceOf( - '\MyTagHandler', - $tagPreReg - ); - - $this->assertFalse( - Tag::registerTagHandler('MyNamespace\MyTag', '\MyTagHandler') - ); - - $tagPostReg = Tag::createInstance( - '@T something', - new DocBlock( - '', - new Context('', array('T' => '\MyNamespace\MyTag')) - ) - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - $this->assertNotInstanceOf( - '\MyTagHandler', - $tagPostReg - ); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * - * @return void - */ - public function testNonExistentTagHandlerRegistration() - { - $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; - $tagPreReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPreReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - - $this->assertFalse(Tag::registerTagHandler('var', 'Non existent')); - - $tagPostReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPostReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock\Tag::registerTagHandler - * - * @return void - */ - public function testIncompatibleTagHandlerRegistration() - { - $currentHandler = __NAMESPACE__ . '\Tag\VarTag'; - $tagPreReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPreReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPreReg - ); - - $this->assertFalse( - Tag::registerTagHandler('var', __NAMESPACE__ . '\TagTest') - ); - - $tagPostReg = Tag::createInstance('@var mixed'); - $this->assertInstanceOf( - $currentHandler, - $tagPostReg - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\Tag', - $tagPostReg - ); - } - - /** - * Test that the \phpDocumentor\Reflection\DocBlock\Tag\VarTag can - * understand the @var doc block. - * - * @param string $type - * @param string $content - * @param string $exDescription - * - * @covers \phpDocumentor\Reflection\DocBlock\Tag - * @dataProvider provideDataForConstuctor - * - * @return void - */ - public function testConstructorParesInputsIntoCorrectFields( - $type, - $content, - $exDescription - ) { - $tag = new Tag($type, $content); - - $this->assertEquals($type, $tag->getName()); - $this->assertEquals($content, $tag->getContent()); - $this->assertEquals($exDescription, $tag->getDescription()); - } - - /** - * Data provider for testConstructorParesInputsIntoCorrectFields - * - * @return array - */ - public function provideDataForConstuctor() - { - // $type, $content, $exDescription - return array( - array( - 'unknown', - 'some content', - 'some content', - ), - array( - 'unknown', - '', - '', - ) - ); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php deleted file mode 100644 index 78c7306d..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlock/Type/CollectionTest.php +++ /dev/null @@ -1,195 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection\DocBlock\Type; - -use phpDocumentor\Reflection\DocBlock\Context; - -/** - * Test class for \phpDocumentor\Reflection\DocBlock\Type\Collection - * - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class CollectionTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::getContext - * - * @return void - */ - public function testConstruct() - { - $collection = new Collection(); - $this->assertCount(0, $collection); - $this->assertEquals('', $collection->getContext()->getNamespace()); - $this->assertCount(0, $collection->getContext()->getNamespaceAliases()); - } - - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct - * - * @return void - */ - public function testConstructWithTypes() - { - $collection = new Collection(array('integer', 'string')); - $this->assertCount(2, $collection); - } - - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct - * - * @return void - */ - public function testConstructWithNamespace() - { - $collection = new Collection(array(), new Context('\My\Space')); - $this->assertEquals('My\Space', $collection->getContext()->getNamespace()); - - $collection = new Collection(array(), new Context('My\Space')); - $this->assertEquals('My\Space', $collection->getContext()->getNamespace()); - - $collection = new Collection(array(), null); - $this->assertEquals('', $collection->getContext()->getNamespace()); - } - - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::__construct - * - * @return void - */ - public function testConstructWithNamespaceAliases() - { - $fixture = array('a' => 'b'); - $collection = new Collection(array(), new Context(null, $fixture)); - $this->assertEquals( - array('a' => '\b'), - $collection->getContext()->getNamespaceAliases() - ); - } - - /** - * @param string $fixture - * @param array $expected - * - * @dataProvider provideTypesToExpand - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add - * - * @return void - */ - public function testAdd($fixture, $expected) - { - $collection = new Collection( - array(), - new Context('\My\Space', array('Alias' => '\My\Space\Aliasing')) - ); - $collection->add($fixture); - - $this->assertSame($expected, $collection->getArrayCopy()); - } - - /** - * @param string $fixture - * @param array $expected - * - * @dataProvider provideTypesToExpandWithoutNamespace - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add - * - * @return void - */ - public function testAddWithoutNamespace($fixture, $expected) - { - $collection = new Collection( - array(), - new Context(null, array('Alias' => '\My\Space\Aliasing')) - ); - $collection->add($fixture); - - $this->assertSame($expected, $collection->getArrayCopy()); - } - - /** - * @covers phpDocumentor\Reflection\DocBlock\Type\Collection::add - * @expectedException InvalidArgumentException - * - * @return void - */ - public function testAddWithInvalidArgument() - { - $collection = new Collection(); - $collection->add(array()); - } - - /** - * Returns the types and their expected values to test the retrieval of - * types. - * - * @param string $method Name of the method consuming this data provider. - * @param string $namespace Name of the namespace to user as basis. - * - * @return string[] - */ - public function provideTypesToExpand($method, $namespace = '\My\Space\\') - { - return array( - array('', array()), - array(' ', array()), - array('int', array('int')), - array('int ', array('int')), - array('string', array('string')), - array('DocBlock', array($namespace.'DocBlock')), - array('DocBlock[]', array($namespace.'DocBlock[]')), - array(' DocBlock ', array($namespace.'DocBlock')), - array('\My\Space\DocBlock', array('\My\Space\DocBlock')), - array('Alias\DocBlock', array('\My\Space\Aliasing\DocBlock')), - array( - 'DocBlock|Tag', - array($namespace .'DocBlock', $namespace .'Tag') - ), - array( - 'DocBlock|null', - array($namespace.'DocBlock', 'null') - ), - array( - '\My\Space\DocBlock|Tag', - array('\My\Space\DocBlock', $namespace.'Tag') - ), - array( - 'DocBlock[]|null', - array($namespace.'DocBlock[]', 'null') - ), - array( - 'DocBlock[]|int[]', - array($namespace.'DocBlock[]', 'int[]') - ), - ); - } - - /** - * Returns the types and their expected values to test the retrieval of - * types when no namespace is available. - * - * @param string $method Name of the method consuming this data provider. - * - * @return string[] - */ - public function provideTypesToExpandWithoutNamespace($method) - { - return $this->provideTypesToExpand($method, '\\'); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php b/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php deleted file mode 100644 index 30eedfc5..00000000 --- a/vendor/phpdocumentor/reflection-docblock/tests/phpDocumentor/Reflection/DocBlockTest.php +++ /dev/null @@ -1,337 +0,0 @@ - - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ - -namespace phpDocumentor\Reflection; - -use phpDocumentor\Reflection\DocBlock\Context; -use phpDocumentor\Reflection\DocBlock\Location; -use phpDocumentor\Reflection\DocBlock\Tag\ReturnTag; - -/** - * Test class for phpDocumentor\Reflection\DocBlock - * - * @author Mike van Riel - * @copyright 2010-2011 Mike van Riel / Naenius. (http://www.naenius.com) - * @license http://www.opensource.org/licenses/mit-license.php MIT - * @link http://phpdoc.org - */ -class DocBlockTest extends \PHPUnit_Framework_TestCase -{ - /** - * @covers \phpDocumentor\Reflection\DocBlock - * - * @return void - */ - public function testConstruct() - { - $fixture = << '\phpDocumentor')), - new Location(2) - ); - $this->assertEquals( - 'This is a short description', - $object->getShortDescription() - ); - $this->assertEquals( - 'This is a long description', - $object->getLongDescription()->getContents() - ); - $this->assertCount(2, $object->getTags()); - $this->assertTrue($object->hasTag('see')); - $this->assertTrue($object->hasTag('return')); - $this->assertFalse($object->hasTag('category')); - - $this->assertSame('MyNamespace', $object->getContext()->getNamespace()); - $this->assertSame( - array('PHPDoc' => '\phpDocumentor'), - $object->getContext()->getNamespaceAliases() - ); - $this->assertSame(2, $object->getLocation()->getLineNumber()); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::splitDocBlock - * - * @return void - */ - public function testConstructWithTagsOnly() - { - $fixture = <<assertEquals('', $object->getShortDescription()); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertCount(2, $object->getTags()); - $this->assertTrue($object->hasTag('see')); - $this->assertTrue($object->hasTag('return')); - $this->assertFalse($object->hasTag('category')); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::isTemplateStart - */ - public function testIfStartOfTemplateIsDiscovered() - { - $fixture = <<assertEquals('', $object->getShortDescription()); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertCount(2, $object->getTags()); - $this->assertTrue($object->hasTag('see')); - $this->assertTrue($object->hasTag('return')); - $this->assertFalse($object->hasTag('category')); - $this->assertTrue($object->isTemplateStart()); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::isTemplateEnd - */ - public function testIfEndOfTemplateIsDiscovered() - { - $fixture = <<assertEquals('', $object->getShortDescription()); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertTrue($object->isTemplateEnd()); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::cleanInput - * - * @return void - */ - public function testConstructOneLiner() - { - $fixture = '/** Short description and nothing more. */'; - $object = new DocBlock($fixture); - $this->assertEquals( - 'Short description and nothing more.', - $object->getShortDescription() - ); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertCount(0, $object->getTags()); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::__construct - * - * @return void - */ - public function testConstructFromReflector() - { - $object = new DocBlock(new \ReflectionClass($this)); - $this->assertEquals( - 'Test class for phpDocumentor\Reflection\DocBlock', - $object->getShortDescription() - ); - $this->assertEquals('', $object->getLongDescription()->getContents()); - $this->assertCount(4, $object->getTags()); - $this->assertTrue($object->hasTag('author')); - $this->assertTrue($object->hasTag('copyright')); - $this->assertTrue($object->hasTag('license')); - $this->assertTrue($object->hasTag('link')); - $this->assertFalse($object->hasTag('category')); - } - - /** - * @expectedException \InvalidArgumentException - * - * @return void - */ - public function testExceptionOnInvalidObject() - { - new DocBlock($this); - } - - public function testDotSeperation() - { - $fixture = <<assertEquals( - 'This is a short description.', - $object->getShortDescription() - ); - $this->assertEquals( - "This is a long description.\nThis is a continuation of the long " - ."description.", - $object->getLongDescription()->getContents() - ); - } - - /** - * @covers \phpDocumentor\Reflection\DocBlock::parseTags - * @expectedException \LogicException - * - * @return void - */ - public function testInvalidTagBlock() - { - if (0 == ini_get('allow_url_include')) { - $this->markTestSkipped('"data" URIs for includes are required.'); - } - - include 'data:text/plain;base64,'. base64_encode( - <<assertEquals( - 'This is a short description.', - $object->getShortDescription() - ); - $this->assertEquals( - 'This is a long description.', - $object->getLongDescription()->getContents() - ); - $tags = $object->getTags(); - $this->assertCount(2, $tags); - $this->assertTrue($object->hasTag('method')); - $this->assertTrue($object->hasTag('Method')); - $this->assertInstanceOf( - __NAMESPACE__ . '\DocBlock\Tag\MethodTag', - $tags[0] - ); - $this->assertInstanceOf( - __NAMESPACE__ . '\DocBlock\Tag', - $tags[1] - ); - $this->assertNotInstanceOf( - __NAMESPACE__ . '\DocBlock\Tag\MethodTag', - $tags[1] - ); - } - - /** - * @depends testConstructFromReflector - * @covers \phpDocumentor\Reflection\DocBlock::getTagsByName - * - * @return void - */ - public function testGetTagsByNameZeroAndOneMatch() - { - $object = new DocBlock(new \ReflectionClass($this)); - $this->assertEmpty($object->getTagsByName('category')); - $this->assertCount(1, $object->getTagsByName('author')); - } - - /** - * @depends testConstructWithTagsOnly - * @covers \phpDocumentor\Reflection\DocBlock::parseTags - * - * @return void - */ - public function testParseMultilineTag() - { - $fixture = <<assertCount(1, $object->getTags()); - } - - /** - * @depends testConstructWithTagsOnly - * @covers \phpDocumentor\Reflection\DocBlock::parseTags - * - * @return void - */ - public function testParseMultilineTagWithLineBreaks() - { - $fixture = <<assertCount(1, $tags = $object->getTags()); - /** @var ReturnTag $tag */ - $tag = reset($tags); - $this->assertEquals("Content on\n multiple lines.\n\n One more, after the break.", $tag->getDescription()); - } - - /** - * @depends testConstructWithTagsOnly - * @covers \phpDocumentor\Reflection\DocBlock::getTagsByName - * - * @return void - */ - public function testGetTagsByNameMultipleMatch() - { - $fixture = <<assertEmpty($object->getTagsByName('category')); - $this->assertCount(1, $object->getTagsByName('return')); - $this->assertCount(2, $object->getTagsByName('param')); - } -} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/DescriptionFactoryTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/DescriptionFactoryTest.php new file mode 100644 index 00000000..d3043f9a --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/DescriptionFactoryTest.php @@ -0,0 +1,174 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Tags\Link; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @covers :: + */ +class DescriptionFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\Description + * @dataProvider provideSimpleExampleDescriptions + */ + public function testDescriptionCanParseASimpleString($contents) + { + $tagFactory = m::mock(TagFactory::class); + $tagFactory->shouldReceive('create')->never(); + + $factory = new DescriptionFactory($tagFactory); + $description = $factory->create($contents, new Context('')); + + $this->assertSame($contents, $description->render()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\Description + * @dataProvider provideEscapeSequences + */ + public function testEscapeSequences($contents, $expected) + { + $tagFactory = m::mock(TagFactory::class); + $tagFactory->shouldReceive('create')->never(); + + $factory = new DescriptionFactory($tagFactory); + $description = $factory->create($contents, new Context('')); + + $this->assertSame($expected, $description->render()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\Description + * @uses phpDocumentor\Reflection\DocBlock\Tags\Link + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testDescriptionCanParseAStringWithInlineTag() + { + $contents = 'This is text for a {@link http://phpdoc.org/ description} that uses an inline tag.'; + $context = new Context(''); + $tagFactory = m::mock(TagFactory::class); + $tagFactory->shouldReceive('create') + ->once() + ->with('@link http://phpdoc.org/ description', $context) + ->andReturn(new Link('http://phpdoc.org/', new Description('description'))) + ; + + $factory = new DescriptionFactory($tagFactory); + $description = $factory->create($contents, $context); + + $this->assertSame($contents, $description->render()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\Description + * @uses phpDocumentor\Reflection\DocBlock\Tags\Link + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testDescriptionCanParseAStringStartingWithInlineTag() + { + $contents = '{@link http://phpdoc.org/ This} is text for a description that starts with an inline tag.'; + $context = new Context(''); + $tagFactory = m::mock(TagFactory::class); + $tagFactory->shouldReceive('create') + ->once() + ->with('@link http://phpdoc.org/ This', $context) + ->andReturn(new Link('http://phpdoc.org/', new Description('This'))) + ; + + $factory = new DescriptionFactory($tagFactory); + $description = $factory->create($contents, $context); + + $this->assertSame($contents, $description->render()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\Description + */ + public function testIfSuperfluousStartingSpacesAreRemoved() + { + $factory = new DescriptionFactory(m::mock(TagFactory::class)); + $descriptionText = <<create($descriptionText, new Context('')); + + $this->assertSame($expectedDescription, $description->render()); + } + + /** + * Provides a series of example strings that the parser should correctly interpret and return. + * + * @return string[][] + */ + public function provideSimpleExampleDescriptions() + { + return [ + ['This is text for a description.'], + ['This is text for a description containing { that is literal.'], + ['This is text for a description containing } that is literal.'], + ['This is text for a description with {just a text} that is not a tag.'], + ]; + } + + public function provideEscapeSequences() + { + return [ + ['This is text for a description with a {@}.', 'This is text for a description with a @.'], + ['This is text for a description with a {}.', 'This is text for a description with a }.'], + ]; + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/DescriptionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/DescriptionTest.php new file mode 100644 index 00000000..b5917a9e --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/DescriptionTest.php @@ -0,0 +1,75 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter; +use phpDocumentor\Reflection\DocBlock\Tags\Generic; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Description + */ +class DescriptionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::__construct + * @covers ::render + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic + * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + */ + public function testDescriptionCanRenderUsingABodyWithPlaceholdersAndTags() + { + $body = 'This is a %1$s body.'; + $expected = 'This is a {@internal significant } body.'; + $tags = [new Generic('internal', new Description('significant '))]; + + $fixture = new Description($body, $tags); + + // without formatter (thus the PassthroughFormatter by default) + $this->assertSame($expected, $fixture->render()); + + // with a custom formatter + $formatter = m::mock(PassthroughFormatter::class); + $formatter->shouldReceive('format')->with($tags[0])->andReturn('@internal significant '); + $this->assertSame($expected, $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::render + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic + * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + */ + public function testDescriptionCanBeCastToString() + { + $body = 'This is a %1$s body.'; + $expected = 'This is a {@internal significant } body.'; + $tags = [new Generic('internal', new Description('significant '))]; + + $fixture = new Description($body, $tags); + + $this->assertSame($expected, (string)$fixture); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testBodyTemplateMustBeAString() + { + new Description([]); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/SerializerTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/SerializerTest.php new file mode 100644 index 00000000..cb2b400f --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/SerializerTest.php @@ -0,0 +1,201 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Serializer + * @covers :: + */ +class SerializerTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::__construct + * @covers ::getDocComment + * @uses phpDocumentor\Reflection\DocBlock\Description + * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses phpDocumentor\Reflection\DocBlock + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic + */ + public function testReconstructsADocCommentFromADocBlock() + { + $expected = <<<'DOCCOMMENT' +/** + * This is a summary + * + * This is a description + * + * @unknown-tag Test description for the unknown tag + */ +DOCCOMMENT; + + $fixture = new Serializer(); + + $docBlock = new DocBlock( + 'This is a summary', + new Description('This is a description'), + [ + new DocBlock\Tags\Generic('unknown-tag', new Description('Test description for the unknown tag')) + ] + ); + + $this->assertSame($expected, $fixture->getDocComment($docBlock)); + } + + /** + * @covers ::__construct + * @covers ::getDocComment + * @uses phpDocumentor\Reflection\DocBlock\Description + * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses phpDocumentor\Reflection\DocBlock + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic + */ + public function testAddPrefixToDocBlock() + { + $expected = <<<'DOCCOMMENT' +aa/** +aa * This is a summary +aa * +aa * This is a description +aa * +aa * @unknown-tag Test description for the unknown tag +aa */ +DOCCOMMENT; + + $fixture = new Serializer(2, 'a'); + + $docBlock = new DocBlock( + 'This is a summary', + new Description('This is a description'), + [ + new DocBlock\Tags\Generic('unknown-tag', new Description('Test description for the unknown tag')) + ] + ); + + $this->assertSame($expected, $fixture->getDocComment($docBlock)); + } + + /** + * @covers ::__construct + * @covers ::getDocComment + * @uses phpDocumentor\Reflection\DocBlock\Description + * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses phpDocumentor\Reflection\DocBlock + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic + */ + public function testAddPrefixToDocBlockExceptFirstLine() + { + $expected = <<<'DOCCOMMENT' +/** +aa * This is a summary +aa * +aa * This is a description +aa * +aa * @unknown-tag Test description for the unknown tag +aa */ +DOCCOMMENT; + + $fixture = new Serializer(2, 'a', false); + + $docBlock = new DocBlock( + 'This is a summary', + new Description('This is a description'), + [ + new DocBlock\Tags\Generic('unknown-tag', new Description('Test description for the unknown tag')) + ] + ); + + $this->assertSame($expected, $fixture->getDocComment($docBlock)); + } + + /** + * @covers ::__construct + * @covers ::getDocComment + * @uses phpDocumentor\Reflection\DocBlock\Description + * @uses phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses phpDocumentor\Reflection\DocBlock + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic + */ + public function testWordwrapsAroundTheGivenAmountOfCharacters() + { + $expected = <<<'DOCCOMMENT' +/** + * This is a + * summary + * + * This is a + * description + * + * @unknown-tag + * Test + * description + * for the + * unknown tag + */ +DOCCOMMENT; + + $fixture = new Serializer(0, '', true, 15); + + $docBlock = new DocBlock( + 'This is a summary', + new Description('This is a description'), + [ + new DocBlock\Tags\Generic('unknown-tag', new Description('Test description for the unknown tag')) + ] + ); + + $this->assertSame($expected, $fixture->getDocComment($docBlock)); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testInitializationFailsIfIndentIsNotAnInteger() + { + new Serializer([]); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testInitializationFailsIfIndentStringIsNotAString() + { + new Serializer(0, []); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testInitializationFailsIfIndentFirstLineIsNotABoolean() + { + new Serializer(0, '', []); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testInitializationFailsIfLineLengthIsNotNullNorAnInteger() + { + new Serializer(0, '', false, []); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/StandardTagFactoryTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/StandardTagFactoryTest.php new file mode 100644 index 00000000..0247da04 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/StandardTagFactoryTest.php @@ -0,0 +1,361 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Tags\Author; +use phpDocumentor\Reflection\DocBlock\Tags\Formatter; +use phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter; +use phpDocumentor\Reflection\DocBlock\Tags\Generic; +use phpDocumentor\Reflection\DocBlock\Tags\Return_; +use phpDocumentor\Reflection\DocBlock\Tags\See; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass phpDocumentor\Reflection\DocBlock\StandardTagFactory + * @covers :: + */ +class StandardTagFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @uses phpDocumentor\Reflection\DocBlock\Tags\Generic + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses phpDocumentor\Reflection\DocBlock\Description + */ + public function testCreatingAGenericTag() + { + $expectedTagName = 'unknown-tag'; + $expectedDescriptionText = 'This is a description'; + $expectedDescription = new Description($expectedDescriptionText); + $context = new Context(''); + + $descriptionFactory = m::mock(DescriptionFactory::class); + $descriptionFactory + ->shouldReceive('create') + ->once() + ->with($expectedDescriptionText, $context) + ->andReturn($expectedDescription) + ; + + $tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class)); + $tagFactory->addService($descriptionFactory, DescriptionFactory::class); + + /** @var Generic $tag */ + $tag = $tagFactory->create('@' . $expectedTagName . ' This is a description', $context); + + $this->assertInstanceOf(Generic::class, $tag); + $this->assertSame($expectedTagName, $tag->getName()); + $this->assertSame($expectedDescription, $tag->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @uses phpDocumentor\Reflection\DocBlock\Tags\Author + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + */ + public function testCreatingASpecificTag() + { + $context = new Context(''); + $tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class)); + + /** @var Author $tag */ + $tag = $tagFactory->create('@author Mike van Riel ', $context); + + $this->assertInstanceOf(Author::class, $tag); + $this->assertSame('author', $tag->getName()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @uses phpDocumentor\Reflection\DocBlock\Tags\See + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + */ + public function testAnEmptyContextIsCreatedIfNoneIsProvided() + { + $fqsen = '\Tag'; + $resolver = m::mock(FqsenResolver::class) + ->shouldReceive('resolve') + ->with('Tag', m::type(Context::class)) + ->andReturn(new Fqsen($fqsen)) + ->getMock() + ; + $descriptionFactory = m::mock(DescriptionFactory::class); + $descriptionFactory->shouldIgnoreMissing(); + + $tagFactory = new StandardTagFactory($resolver); + $tagFactory->addService($descriptionFactory, DescriptionFactory::class); + + /** @var See $tag */ + $tag = $tagFactory->create('@see Tag'); + + $this->assertInstanceOf(See::class, $tag); + $this->assertSame($fqsen, (string)$tag->getReference()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @uses phpDocumentor\Reflection\DocBlock\Tags\Author + * @uses phpDocumentor\Reflection\DocBlock\Tags\BaseTag + */ + public function testPassingYourOwnSetOfTagHandlers() + { + $context = new Context(''); + $tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class), ['user' => Author::class]); + + /** @var Author $tag */ + $tag = $tagFactory->create('@user Mike van Riel ', $context); + + $this->assertInstanceOf(Author::class, $tag); + $this->assertSame('author', $tag->getName()); + } + + /** + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage The tag "@user/myuser" does not seem to be wellformed, please check it for errors + */ + public function testExceptionIsThrownIfProvidedTagIsNotWellformed() + { + $this->markTestIncomplete( + 'For some reason this test fails; once I have access to a RegEx analyzer I will have to test the regex' + ) + ; + $tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class)); + $tagFactory->create('@user[myuser'); + } + + /** + * @covers ::__construct + * @covers ::addParameter + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + */ + public function testAddParameterToServiceLocator() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + $tagFactory->addParameter('myParam', 'myValue'); + + $this->assertAttributeSame( + [FqsenResolver::class => $resolver, 'myParam' => 'myValue'], + 'serviceLocator', + $tagFactory + ) + ; + } + + /** + * @covers ::addService + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + */ + public function testAddServiceToServiceLocator() + { + $service = new PassthroughFormatter(); + + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + $tagFactory->addService($service); + + $this->assertAttributeSame( + [FqsenResolver::class => $resolver, PassthroughFormatter::class => $service], + 'serviceLocator', + $tagFactory + ) + ; + } + + /** + * @covers ::addService + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + */ + public function testInjectConcreteServiceForInterfaceToServiceLocator() + { + $interfaceName = Formatter::class; + $service = new PassthroughFormatter(); + + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + $tagFactory->addService($service, $interfaceName); + + $this->assertAttributeSame( + [FqsenResolver::class => $resolver, $interfaceName => $service], + 'serviceLocator', + $tagFactory + ) + ; + } + + /** + * @covers ::registerTagHandler + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::create + * @uses phpDocumentor\Reflection\DocBlock\Tags\Author + */ + public function testRegisteringAHandlerForANewTag() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + + $tagFactory->registerTagHandler('my-tag', Author::class); + + // Assert by trying to create one + $tag = $tagFactory->create('@my-tag Mike van Riel '); + $this->assertInstanceOf(Author::class, $tag); + } + + /** + * @covers ::registerTagHandler + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @expectedException \InvalidArgumentException + */ + public function testHandlerRegistrationFailsIfProvidedTagNameIsNotAString() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + + $tagFactory->registerTagHandler([], Author::class); + } + + /** + * @covers ::registerTagHandler + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @expectedException \InvalidArgumentException + */ + public function testHandlerRegistrationFailsIfProvidedTagNameIsEmpty() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + + $tagFactory->registerTagHandler('', Author::class); + } + + /** + * @covers ::registerTagHandler + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @expectedException \InvalidArgumentException + */ + public function testHandlerRegistrationFailsIfProvidedTagNameIsNamespaceButNotFullyQualified() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + + $tagFactory->registerTagHandler('Name\Spaced\Tag', Author::class); + } + + /** + * @covers ::registerTagHandler + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @expectedException \InvalidArgumentException + */ + public function testHandlerRegistrationFailsIfProvidedHandlerIsNotAString() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + + $tagFactory->registerTagHandler('my-tag', []); + } + + /** + * @covers ::registerTagHandler + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @expectedException \InvalidArgumentException + */ + public function testHandlerRegistrationFailsIfProvidedHandlerIsEmpty() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + + $tagFactory->registerTagHandler('my-tag', ''); + } + + /** + * @covers ::registerTagHandler + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @expectedException \InvalidArgumentException + */ + public function testHandlerRegistrationFailsIfProvidedHandlerIsNotAnExistingClassName() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + + $tagFactory->registerTagHandler('my-tag', 'IDoNotExist'); + } + + /** + * @covers ::registerTagHandler + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @expectedException \InvalidArgumentException + */ + public function testHandlerRegistrationFailsIfProvidedHandlerDoesNotImplementTheTagInterface() + { + $resolver = m::mock(FqsenResolver::class); + $tagFactory = new StandardTagFactory($resolver); + + $tagFactory->registerTagHandler('my-tag', 'stdClass'); + } + + /** + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::__construct + * @uses phpDocumentor\Reflection\DocBlock\StandardTagFactory::addService + * @uses phpDocumentor\Reflection\Docblock\Description + * @uses phpDocumentor\Reflection\Docblock\Tags\Return_ + * @uses phpDocumentor\Reflection\Docblock\Tags\BaseTag + */ + public function testReturntagIsMappedCorrectly() + { + $context = new Context(''); + + $descriptionFactory = m::mock(DescriptionFactory::class); + $descriptionFactory + ->shouldReceive('create') + ->once() + ->with('', $context) + ->andReturn(new Description('')) + ; + + $typeResolver = new TypeResolver(); + + $tagFactory = new StandardTagFactory(m::mock(FqsenResolver::class)); + $tagFactory->addService($descriptionFactory, DescriptionFactory::class); + $tagFactory->addService($typeResolver, TypeResolver::class); + + + /** @var Return_ $tag */ + $tag = $tagFactory->create('@return mixed', $context); + + $this->assertInstanceOf(Return_::class, $tag); + $this->assertSame('return', $tag->getName()); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/AuthorTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/AuthorTest.php new file mode 100644 index 00000000..a54954f8 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/AuthorTest.php @@ -0,0 +1,148 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Author + * @covers :: + */ +class AuthorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Author('Mike van Riel', 'mike@phpdoc.org'); + + $this->assertSame('author', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Author('Mike van Riel', 'mike@phpdoc.org'); + + $this->assertSame('@author Mike van Riel', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Author('Mike van Riel', 'mike@phpdoc.org'); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getAuthorName + */ + public function testHasTheAuthorName() + { + $expected = 'Mike van Riel'; + + $fixture = new Author($expected, 'mike@phpdoc.org'); + + $this->assertSame($expected, $fixture->getAuthorName()); + } + + /** + * @covers ::__construct + * @covers ::getAuthorName + * @expectedException \InvalidArgumentException + */ + public function testInitializationFailsIfAuthorNameIsNotAString() + { + new Author([], 'mike@phpdoc.org'); + } + + /** + * @covers ::__construct + * @covers ::getEmail + */ + public function testHasTheAuthorMailAddress() + { + $expected = 'mike@phpdoc.org'; + + $fixture = new Author('Mike van Riel', $expected); + + $this->assertSame($expected, $fixture->getEmail()); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testInitializationFailsIfEmailIsNotAString() + { + new Author('Mike van Riel', []); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testInitializationFailsIfEmailIsNotValid() + { + new Author('Mike van Riel', 'mike'); + } + + /** + * @covers ::__construct + * @covers ::__toString + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Author('Mike van Riel', 'mike@phpdoc.org'); + + $this->assertSame('Mike van Riel', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author:: + */ + public function testFactoryMethod() + { + $fixture = Author::create('Mike van Riel '); + + $this->assertSame('Mike van Riel', (string)$fixture); + $this->assertSame('Mike van Riel', $fixture->getAuthorName()); + $this->assertSame('mike@phpdoc.org', $fixture->getEmail()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Author:: + */ + public function testFactoryMethodReturnsNullIfItCouldNotReadBody() + { + $this->assertNull(Author::create('dfgr<')); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/CoversTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/CoversTest.php new file mode 100644 index 00000000..a2b5e4b3 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/CoversTest.php @@ -0,0 +1,155 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Covers + * @covers :: + */ +class CoversTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Covers::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Covers(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('covers', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Covers::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Covers::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Covers(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('@covers \DateTime Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Covers::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Covers(new Fqsen('\DateTime'), new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getReference + */ + public function testHasReferenceToFqsen() + { + $expected = new Fqsen('\DateTime'); + + $fixture = new Covers($expected); + + $this->assertSame($expected, $fixture->getReference()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Covers(new Fqsen('\DateTime'), $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Covers(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('\DateTime Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Covers:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\FqsenResolver + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Fqsen + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $resolver = m::mock(FqsenResolver::class); + $context = new Context(''); + + $fqsen = new Fqsen('\DateTime'); + $description = new Description('My Description'); + + $descriptionFactory + ->shouldReceive('create')->with('My Description', $context)->andReturn($description); + $resolver->shouldReceive('resolve')->with('DateTime', $context)->andReturn($fqsen); + + $fixture = Covers::create('DateTime My Description', $descriptionFactory, $resolver, $context); + + $this->assertSame('\DateTime My Description', (string)$fixture); + $this->assertSame($fqsen, $fixture->getReference()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + $this->assertNull(Covers::create([])); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotEmpty() + { + $this->assertNull(Covers::create('')); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/DeprecatedTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/DeprecatedTest.php new file mode 100644 index 00000000..eca9664f --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/DeprecatedTest.php @@ -0,0 +1,166 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Deprecated + * @covers :: + */ +class DeprecatedTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Deprecated('1.0', new Description('Description')); + + $this->assertSame('deprecated', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Deprecated('1.0', new Description('Description')); + + $this->assertSame('@deprecated 1.0 Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Deprecated('1.0', new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getVersion + */ + public function testHasVersionNumber() + { + $expected = '1.0'; + + $fixture = new Deprecated($expected); + + $this->assertSame($expected, $fixture->getVersion()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Deprecated('1.0', $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Deprecated('1.0', new Description('Description')); + + $this->assertSame('1.0 Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $version = '1.0'; + $description = new Description('My Description'); + + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Deprecated::create('1.0 My Description', $descriptionFactory, $context); + + $this->assertSame('1.0 My Description', (string)$fixture); + $this->assertSame($version, $fixture->getVersion()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Deprecated:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethodCreatesEmptyDeprecatedTag() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $descriptionFactory->shouldReceive('create')->never(); + + $fixture = Deprecated::create('', $descriptionFactory, new Context('')); + + $this->assertSame('', (string)$fixture); + $this->assertSame(null, $fixture->getVersion()); + $this->assertSame(null, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfVersionIsNotString() + { + $this->assertNull(Deprecated::create([])); + } + + /** + * @covers ::create + */ + public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() + { + $this->assertNull(Deprecated::create('dkhf<')); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/Formatter/PassthroughFormatterTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/Formatter/PassthroughFormatterTest.php new file mode 100644 index 00000000..045a197f --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/Formatter/PassthroughFormatterTest.php @@ -0,0 +1,41 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags\Formatter; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\Tags\Generic; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + */ +class PassthroughFormatterTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::format + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic + */ + public function testFormatterCallsToStringAndReturnsAStandardRepresentation() + { + $expected = '@unknown-tag This is a description'; + + $fixture = new PassthroughFormatter(); + + $this->assertSame( + $expected, + $fixture->format(new Generic('unknown-tag', new Description('This is a description'))) + ); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/GenericTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/GenericTest.php new file mode 100644 index 00000000..02fa5300 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/GenericTest.php @@ -0,0 +1,146 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @generic http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Generic + * @covers :: + */ +class GenericTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Generic('generic', new Description('Description')); + + $this->assertSame('generic', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Generic('generic', new Description('Description')); + + $this->assertSame('@generic Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Generic('generic', new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Generic('generic', $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Generic('generic', new Description('Description')); + + $this->assertSame('Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Generic:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $generics = 'generic'; + $description = new Description('My Description'); + + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Generic::create('My Description', 'generic', $descriptionFactory, $context); + + $this->assertSame('My Description', (string)$fixture); + $this->assertSame($generics, $fixture->getName()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfNameIsNotString() + { + Generic::create('', []); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfNameIsNotEmpty() + { + Generic::create('', ''); + } + + /** + * @covers ::create + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfNameContainsIllegalCharacters() + { + Generic::create('', 'name/myname'); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/LinkTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/LinkTest.php new file mode 100644 index 00000000..9940aec7 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/LinkTest.php @@ -0,0 +1,158 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Link + * @covers :: + */ +class LinkTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Link('http://this.is.my/link', new Description('Description')); + + $this->assertSame('link', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Link('http://this.is.my/link', new Description('Description')); + + $this->assertSame('@link http://this.is.my/link Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Link('http://this.is.my/link', new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getLink + */ + public function testHasLinkUrl() + { + $expected = 'http://this.is.my/link'; + + $fixture = new Link($expected); + + $this->assertSame($expected, $fixture->getLink()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Link('http://this.is.my/link', $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Link('http://this.is.my/link', new Description('Description')); + + $this->assertSame('http://this.is.my/link Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $links = 'http://this.is.my/link'; + $description = new Description('My Description'); + + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Link::create('http://this.is.my/link My Description', $descriptionFactory, $context); + + $this->assertSame('http://this.is.my/link My Description', (string)$fixture); + $this->assertSame($links, $fixture->getLink()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Link:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethodCreatesEmptyLinkTag() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $descriptionFactory->shouldReceive('create')->never(); + + $fixture = Link::create('', $descriptionFactory, new Context('')); + + $this->assertSame('', (string)$fixture); + $this->assertSame('', $fixture->getLink()); + $this->assertSame(null, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfVersionIsNotString() + { + $this->assertNull(Link::create([])); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/MethodTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/MethodTest.php new file mode 100644 index 00000000..aae6472f --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/MethodTest.php @@ -0,0 +1,410 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Array_; +use phpDocumentor\Reflection\Types\Compound; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Integer; +use phpDocumentor\Reflection\Types\Object_; +use phpDocumentor\Reflection\Types\String_; +use phpDocumentor\Reflection\Types\Void_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Method + * @covers :: + */ +class MethodTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Method('myMethod'); + + $this->assertSame('method', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::isStatic + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $arguments = [ + ['name' => 'argument1', 'type' => new String_()], + ['name' => 'argument2', 'type' => new Object_()] + ]; + $fixture = new Method('myMethod', $arguments, new Void_(), true, new Description('My Description')); + + $this->assertSame( + '@method static void myMethod(string $argument1, object $argument2) My Description', + $fixture->render() + ); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Method('myMethod'); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getMethodName + */ + public function testHasMethodName() + { + $expected = 'myMethod'; + + $fixture = new Method($expected); + + $this->assertSame($expected, $fixture->getMethodName()); + } + + /** + * @covers ::__construct + * @covers ::getArguments + */ + public function testHasArguments() + { + $arguments = [ + [ 'name' => 'argument1', 'type' => new String_() ] + ]; + + $fixture = new Method('myMethod', $arguments); + + $this->assertSame($arguments, $fixture->getArguments()); + } + + /** + * @covers ::__construct + * @covers ::getArguments + */ + public function testArgumentsMayBePassedAsString() + { + $arguments = ['argument1']; + $expected = [ + [ 'name' => $arguments[0], 'type' => new Void_() ] + ]; + + $fixture = new Method('myMethod', $arguments); + + $this->assertEquals($expected, $fixture->getArguments()); + } + + /** + * @covers ::__construct + * @covers ::getArguments + */ + public function testArgumentTypeCanBeInferredAsVoid() + { + $arguments = [ [ 'name' => 'argument1' ] ]; + $expected = [ + [ 'name' => $arguments[0]['name'], 'type' => new Void_() ] + ]; + + $fixture = new Method('myMethod', $arguments); + + $this->assertEquals($expected, $fixture->getArguments()); + } + + /** + * @covers ::__construct + * @covers ::getReturnType + */ + public function testHasReturnType() + { + $expected = new String_(); + + $fixture = new Method('myMethod', [], $expected); + + $this->assertSame($expected, $fixture->getReturnType()); + } + + /** + * @covers ::__construct + * @covers ::getReturnType + */ + public function testReturnTypeCanBeInferredAsVoid() + { + $fixture = new Method('myMethod', []); + + $this->assertEquals(new Void_(), $fixture->getReturnType()); + } + + /** + * @covers ::__construct + * @covers ::isStatic + */ + public function testMethodCanBeStatic() + { + $expected = false; + $fixture = new Method('myMethod', [], null, $expected); + $this->assertSame($expected, $fixture->isStatic()); + + $expected = true; + $fixture = new Method('myMethod', [], null, $expected); + $this->assertSame($expected, $fixture->isStatic()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Method('myMethod', [], null, false, $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method::isStatic + */ + public function testStringRepresentationIsReturned() + { + $arguments = [ + ['name' => 'argument1', 'type' => new String_()], + ['name' => 'argument2', 'type' => new Object_()] + ]; + $fixture = new Method('myMethod', $arguments, new Void_(), true, new Description('My Description')); + + $this->assertSame( + 'static void myMethod(string $argument1, object $argument2) My Description', + (string)$fixture + ); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Fqsen + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $resolver = new TypeResolver(); + $context = new Context(''); + + $description = new Description('My Description'); + $expectedArguments = [ + [ 'name' => 'argument1', 'type' => new String_() ], + [ 'name' => 'argument2', 'type' => new Void_() ] + ]; + + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Method::create( + 'static void myMethod(string $argument1, $argument2) My Description', + $resolver, + $descriptionFactory, + $context + ); + + $this->assertSame('static void myMethod(string $argument1, void $argument2) My Description', (string)$fixture); + $this->assertSame('myMethod', $fixture->getMethodName()); + $this->assertEquals($expectedArguments, $fixture->getArguments()); + $this->assertInstanceOf(Void_::class, $fixture->getReturnType()); + $this->assertSame($description, $fixture->getDescription()); + } + + public function collectionReturnTypesProvider() + { + return [ + ['int[]', Array_::class, Integer::class, Compound::class], + ['int[][]', Array_::class, Array_::class, Compound::class], + ['Object[]', Array_::class, Object_::class, Compound::class], + ['array[]', Array_::class, Array_::class, Compound::class], + ]; + } + + /** + * @dataProvider collectionReturnTypesProvider + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method:: + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\Types\Array_ + * @uses \phpDocumentor\Reflection\Types\Compound + * @uses \phpDocumentor\Reflection\Types\Integer + * @uses \phpDocumentor\Reflection\Types\Object_ + * @param string $returnType + * @param string $expectedType + * @param string $expectedValueType + * @param string null $expectedKeyType + */ + public function testCollectionReturnTypes( + $returnType, + $expectedType, + $expectedValueType = null, + $expectedKeyType = null + ) { $resolver = new TypeResolver(); + $descriptionFactory = m::mock(DescriptionFactory::class); + $descriptionFactory->shouldReceive('create')->with('', null)->andReturn(new Description('')); + + $fixture = Method::create("$returnType myMethod(\$arg)", $resolver, $descriptionFactory); + $returnType = $fixture->getReturnType(); + $this->assertInstanceOf($expectedType, $returnType); + + if ($returnType instanceof Array_) { + $this->assertInstanceOf($expectedValueType, $returnType->getValueType()); + $this->assertInstanceOf($expectedKeyType, $returnType->getKeyType()); + } + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + Method::create([]); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsEmpty() + { + Method::create(''); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodReturnsNullIfBodyIsIncorrect() + { + $this->assertNull(Method::create('body(')); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + Method::create('body'); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + Method::create('body', new TypeResolver()); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testCreationFailsIfBodyIsNotString() + { + new Method([]); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testCreationFailsIfBodyIsEmpty() + { + new Method(''); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testCreationFailsIfStaticIsNotBoolean() + { + new Method('body', [], null, []); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testCreationFailsIfArgumentRecordContainsInvalidEntry() + { + new Method('body', [ [ 'name' => 'myName', 'unknown' => 'nah' ] ]); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Method:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Fqsen + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testCreateMethodParenthesisMissing() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $resolver = new TypeResolver(); + $context = new Context(''); + + $description = new Description('My Description'); + + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Method::create( + 'static void myMethod My Description', + $resolver, + $descriptionFactory, + $context + ); + + $this->assertSame('static void myMethod() My Description', (string)$fixture); + $this->assertSame('myMethod', $fixture->getMethodName()); + $this->assertEquals([], $fixture->getArguments()); + $this->assertInstanceOf(Void_::class, $fixture->getReturnType()); + $this->assertSame($description, $fixture->getDescription()); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ParamTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ParamTest.php new file mode 100644 index 00000000..0c718ab7 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ParamTest.php @@ -0,0 +1,228 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\String_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Param + * @covers :: + */ +class ParamTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Param('myParameter', null, false, new Description('Description')); + + $this->assertSame('param', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param::isVariadic + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Param('myParameter', new String_(), true, new Description('Description')); + $this->assertSame('@param string ...$myParameter Description', $fixture->render()); + + $fixture = new Param('myParameter', new String_(), false, new Description('Description')); + $this->assertSame('@param string $myParameter Description', $fixture->render()); + + $fixture = new Param('myParameter', null, false, new Description('Description')); + $this->assertSame('@param $myParameter Description', $fixture->render()); + + $fixture = new Param('myParameter'); + $this->assertSame('@param $myParameter', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Param('myParameter'); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getVariableName + */ + public function testHasVariableName() + { + $expected = 'myParameter'; + + $fixture = new Param($expected); + + $this->assertSame($expected, $fixture->getVariableName()); + } + + /** + * @covers ::__construct + * @covers ::getType + */ + public function testHasType() + { + $expected = new String_(); + + $fixture = new Param('myParameter', $expected); + + $this->assertSame($expected, $fixture->getType()); + } + + /** + * @covers ::__construct + * @covers ::isVariadic + */ + public function testIfParameterIsVariadic() + { + $fixture = new Param('myParameter', new String_(), false); + $this->assertFalse($fixture->isVariadic()); + + $fixture = new Param('myParameter', new String_(), true); + $this->assertTrue($fixture->isVariadic()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Param('1.0', null, false, $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::isVariadic + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\String_ + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Param('myParameter', new String_(), true, new Description('Description')); + + $this->assertSame('string ...$myParameter Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $typeResolver = new TypeResolver(); + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $description = new Description('My Description'); + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Param::create('string ...$myParameter My Description', $typeResolver, $descriptionFactory, $context); + + $this->assertSame('string ...$myParameter My Description', (string)$fixture); + $this->assertSame('myParameter', $fixture->getVariableName()); + $this->assertInstanceOf(String_::class, $fixture->getType()); + $this->assertTrue($fixture->isVariadic()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Param:: + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfEmptyBodyIsGiven() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + Param::create('', new TypeResolver(), $descriptionFactory); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + Param::create([]); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + Param::create('body'); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\TypeResolver + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + Param::create('body', new TypeResolver()); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfVariableNameIsNotString() + { + new Param([]); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfVariadicIsNotBoolean() + { + new Param('', null, []); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyReadTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyReadTest.php new file mode 100644 index 00000000..c3fb7700 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyReadTest.php @@ -0,0 +1,201 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\String_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead + * @covers :: + */ +class PropertyReadTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new PropertyRead('myProperty', null, new Description('Description')); + + $this->assertSame('property-read', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new PropertyRead('myProperty', new String_(), new Description('Description')); + $this->assertSame('@property-read string $myProperty Description', $fixture->render()); + + $fixture = new PropertyRead('myProperty', null, new Description('Description')); + $this->assertSame('@property-read $myProperty Description', $fixture->render()); + + $fixture = new PropertyRead('myProperty'); + $this->assertSame('@property-read $myProperty', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new PropertyRead('myProperty'); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getVariableName + */ + public function testHasVariableName() + { + $expected = 'myProperty'; + + $fixture = new PropertyRead($expected); + + $this->assertSame($expected, $fixture->getVariableName()); + } + + /** + * @covers ::__construct + * @covers ::getType + */ + public function testHasType() + { + $expected = new String_(); + + $fixture = new PropertyRead('myProperty', $expected); + + $this->assertSame($expected, $fixture->getType()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new PropertyRead('1.0', null, $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\String_ + */ + public function testStringRepresentationIsReturned() + { + $fixture = new PropertyRead('myProperty', new String_(), new Description('Description')); + + $this->assertSame('string $myProperty Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $typeResolver = new TypeResolver(); + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $description = new Description('My Description'); + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = PropertyRead::create('string $myProperty My Description', $typeResolver, $descriptionFactory, + $context); + + $this->assertSame('string $myProperty My Description', (string)$fixture); + $this->assertSame('myProperty', $fixture->getVariableName()); + $this->assertInstanceOf(String_::class, $fixture->getType()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyRead:: + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfEmptyBodyIsGiven() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + PropertyRead::create('', new TypeResolver(), $descriptionFactory); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + PropertyRead::create([]); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + PropertyRead::create('body'); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\TypeResolver + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + PropertyRead::create('body', new TypeResolver()); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfVariableNameIsNotString() + { + new PropertyRead([]); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyTest.php new file mode 100644 index 00000000..908dfb28 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyTest.php @@ -0,0 +1,200 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\String_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Property + * @covers :: + */ +class PropertyTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Property('myProperty', null, new Description('Description')); + + $this->assertSame('property', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Property('myProperty', new String_(), new Description('Description')); + $this->assertSame('@property string $myProperty Description', $fixture->render()); + + $fixture = new Property('myProperty', null, new Description('Description')); + $this->assertSame('@property $myProperty Description', $fixture->render()); + + $fixture = new Property('myProperty'); + $this->assertSame('@property $myProperty', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Property('myProperty'); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getVariableName + */ + public function testHasVariableName() + { + $expected = 'myProperty'; + + $fixture = new Property($expected); + + $this->assertSame($expected, $fixture->getVariableName()); + } + + /** + * @covers ::__construct + * @covers ::getType + */ + public function testHasType() + { + $expected = new String_(); + + $fixture = new Property('myProperty', $expected); + + $this->assertSame($expected, $fixture->getType()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Property('1.0', null, $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\String_ + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Property('myProperty', new String_(), new Description('Description')); + + $this->assertSame('string $myProperty Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $typeResolver = new TypeResolver(); + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $description = new Description('My Description'); + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Property::create('string $myProperty My Description', $typeResolver, $descriptionFactory, $context); + + $this->assertSame('string $myProperty My Description', (string)$fixture); + $this->assertSame('myProperty', $fixture->getVariableName()); + $this->assertInstanceOf(String_::class, $fixture->getType()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Property:: + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfEmptyBodyIsGiven() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + Property::create('', new TypeResolver(), $descriptionFactory); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + Property::create([]); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + Property::create('body'); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\TypeResolver + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + Property::create('body', new TypeResolver()); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfVariableNameIsNotString() + { + new Property([]); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyWriteTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyWriteTest.php new file mode 100644 index 00000000..5ea6524c --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/PropertyWriteTest.php @@ -0,0 +1,201 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\String_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite + * @covers :: + */ +class PropertyWriteTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new PropertyWrite('myProperty', null, new Description('Description')); + + $this->assertSame('property-write', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new PropertyWrite('myProperty', new String_(), new Description('Description')); + $this->assertSame('@property-write string $myProperty Description', $fixture->render()); + + $fixture = new PropertyWrite('myProperty', null, new Description('Description')); + $this->assertSame('@property-write $myProperty Description', $fixture->render()); + + $fixture = new PropertyWrite('myProperty'); + $this->assertSame('@property-write $myProperty', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new PropertyWrite('myProperty'); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getVariableName + */ + public function testHasVariableName() + { + $expected = 'myProperty'; + + $fixture = new PropertyWrite($expected); + + $this->assertSame($expected, $fixture->getVariableName()); + } + + /** + * @covers ::__construct + * @covers ::getType + */ + public function testHasType() + { + $expected = new String_(); + + $fixture = new PropertyWrite('myProperty', $expected); + + $this->assertSame($expected, $fixture->getType()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new PropertyWrite('1.0', null, $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\String_ + */ + public function testStringRepresentationIsReturned() + { + $fixture = new PropertyWrite('myProperty', new String_(), new Description('Description')); + + $this->assertSame('string $myProperty Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $typeResolver = new TypeResolver(); + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $description = new Description('My Description'); + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = PropertyWrite::create('string $myProperty My Description', $typeResolver, $descriptionFactory, + $context); + + $this->assertSame('string $myProperty My Description', (string)$fixture); + $this->assertSame('myProperty', $fixture->getVariableName()); + $this->assertInstanceOf(String_::class, $fixture->getType()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\PropertyWrite:: + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfEmptyBodyIsGiven() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + PropertyWrite::create('', new TypeResolver(), $descriptionFactory); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + PropertyWrite::create([]); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + PropertyWrite::create('body'); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\TypeResolver + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + PropertyWrite::create('body', new TypeResolver()); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfVariableNameIsNotString() + { + new PropertyWrite([]); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ReturnTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ReturnTest.php new file mode 100644 index 00000000..2bc54391 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ReturnTest.php @@ -0,0 +1,170 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\String_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Return_ + * @covers :: + */ +class ReturnTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Return_(new String_(), new Description('Description')); + + $this->assertSame('return', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Return_(new String_(), new Description('Description')); + + $this->assertSame('@return string Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Return_(new String_(), new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getType + */ + public function testHasType() + { + $expected = new String_(); + + $fixture = new Return_($expected); + + $this->assertSame($expected, $fixture->getType()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Return_(new String_(), $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Return_(new String_(), new Description('Description')); + + $this->assertSame('string Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Return_:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\String_ + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $resolver = new TypeResolver(); + $context = new Context(''); + + $type = new String_(); + $description = new Description('My Description'); + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Return_::create('string My Description', $resolver, $descriptionFactory, $context); + + $this->assertSame('string My Description', (string)$fixture); + $this->assertEquals($type, $fixture->getType()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + $this->assertNull(Return_::create([])); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotEmpty() + { + $this->assertNull(Return_::create('')); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + Return_::create('body'); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + Return_::create('body', new TypeResolver()); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SeeTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SeeTest.php new file mode 100644 index 00000000..8d3e3e8c --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SeeTest.php @@ -0,0 +1,173 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\See + * @covers :: + */ +class SeeTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new See(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('see', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new See(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('@see \DateTime Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new See(new Fqsen('\DateTime'), new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getReference + */ + public function testHasReferenceToFqsen() + { + $expected = new Fqsen('\DateTime'); + + $fixture = new See($expected); + + $this->assertSame($expected, $fixture->getReference()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new See(new Fqsen('\DateTime'), $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new See(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('\DateTime Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\See:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\FqsenResolver + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Fqsen + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $resolver = m::mock(FqsenResolver::class); + $context = new Context(''); + + $fqsen = new Fqsen('\DateTime'); + $description = new Description('My Description'); + + $descriptionFactory + ->shouldReceive('create')->with('My Description', $context)->andReturn($description); + $resolver->shouldReceive('resolve')->with('DateTime', $context)->andReturn($fqsen); + + $fixture = See::create('DateTime My Description', $resolver, $descriptionFactory, $context); + + $this->assertSame('\DateTime My Description', (string)$fixture); + $this->assertSame($fqsen, $fixture->getReference()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + $this->assertNull(See::create([])); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotEmpty() + { + $this->assertNull(See::create('')); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + See::create('body'); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + See::create('body', new FqsenResolver()); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SinceTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SinceTest.php new file mode 100644 index 00000000..3f42db5d --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SinceTest.php @@ -0,0 +1,166 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Since + * @covers :: + */ +class SinceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Since::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Since('1.0', new Description('Description')); + + $this->assertSame('since', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Since::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Since::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Since('1.0', new Description('Description')); + + $this->assertSame('@since 1.0 Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Since::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Since('1.0', new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getVersion + */ + public function testHasVersionNumber() + { + $expected = '1.0'; + + $fixture = new Since($expected); + + $this->assertSame($expected, $fixture->getVersion()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Since('1.0', $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Since('1.0', new Description('Description')); + + $this->assertSame('1.0 Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Since:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $version = '1.0'; + $description = new Description('My Description'); + + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Since::create('1.0 My Description', $descriptionFactory, $context); + + $this->assertSame('1.0 My Description', (string)$fixture); + $this->assertSame($version, $fixture->getVersion()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Since:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethodCreatesEmptySinceTag() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $descriptionFactory->shouldReceive('create')->never(); + + $fixture = Since::create('', $descriptionFactory, new Context('')); + + $this->assertSame('', (string)$fixture); + $this->assertSame(null, $fixture->getVersion()); + $this->assertSame(null, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfSinceIsNotString() + { + $this->assertNull(Since::create([])); + } + + /** + * @covers ::create + */ + public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() + { + $this->assertNull(Since::create('dkhf<')); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SourceTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SourceTest.php new file mode 100644 index 00000000..cbf01f65 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/SourceTest.php @@ -0,0 +1,199 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\String_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Source + * @covers :: + */ +class SourceTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Source::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Source(1, null, new Description('Description')); + + $this->assertSame('source', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Source::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Source::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Source(1, 10, new Description('Description')); + $this->assertSame('@source 1 10 Description', $fixture->render()); + + $fixture = new Source(1, null, new Description('Description')); + $this->assertSame('@source 1 Description', $fixture->render()); + + $fixture = new Source(1); + $this->assertSame('@source 1', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Source::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Source(1); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getStartingLine + */ + public function testHasStartingLine() + { + $expected = 1; + + $fixture = new Source($expected); + + $this->assertSame($expected, $fixture->getStartingLine()); + } + + /** + * @covers ::__construct + * @covers ::getLineCount + */ + public function testHasLineCount() + { + $expected = 2; + + $fixture = new Source(1, $expected); + + $this->assertSame($expected, $fixture->getLineCount()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Source('1', null, $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\String_ + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Source(1, 10, new Description('Description')); + + $this->assertSame('1 10 Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Source:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $description = new Description('My Description'); + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Source::create('1 10 My Description', $descriptionFactory, $context); + + $this->assertSame('1 10 My Description', (string)$fixture); + $this->assertSame(1, $fixture->getStartingLine()); + $this->assertSame(10, $fixture->getLineCount()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Source:: + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfEmptyBodyIsGiven() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + Source::create('', $descriptionFactory); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + Source::create([]); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\TypeResolver + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + Source::create('1'); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfStartingLineIsNotInteger() + { + new Source('blabla'); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfLineCountIsNotIntegerOrNull() + { + new Source('1', []); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ThrowsTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ThrowsTest.php new file mode 100644 index 00000000..657d6ca5 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/ThrowsTest.php @@ -0,0 +1,170 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\String_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Throws + * @covers :: + */ +class ThrowsTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Throws::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Throws(new String_(), new Description('Description')); + + $this->assertSame('throws', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Throws::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Throws::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Throws(new String_(), new Description('Description')); + + $this->assertSame('@throws string Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Throws::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Throws(new String_(), new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getType + */ + public function testHasType() + { + $expected = new String_(); + + $fixture = new Throws($expected); + + $this->assertSame($expected, $fixture->getType()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Throws(new String_(), $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Throws(new String_(), new Description('Description')); + + $this->assertSame('string Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Throws:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\String_ + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $resolver = new TypeResolver(); + $context = new Context(''); + + $type = new String_(); + $description = new Description('My Description'); + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Throws::create('string My Description', $resolver, $descriptionFactory, $context); + + $this->assertSame('string My Description', (string)$fixture); + $this->assertEquals($type, $fixture->getType()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + $this->assertNull(Throws::create([])); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotEmpty() + { + $this->assertNull(Throws::create('')); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + Throws::create('body'); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + Throws::create('body', new TypeResolver()); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/UsesTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/UsesTest.php new file mode 100644 index 00000000..419f7e36 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/UsesTest.php @@ -0,0 +1,174 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\FqsenResolver; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Uses + * @covers :: + */ +class UsesTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Uses::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('uses', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Uses::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Uses::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('@uses \DateTime Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Uses::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getReference + */ + public function testHasReferenceToFqsen() + { + $expected = new Fqsen('\DateTime'); + + $fixture = new Uses($expected); + + $this->assertSame($expected, $fixture->getReference()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Uses(new Fqsen('\DateTime'), $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Uses(new Fqsen('\DateTime'), new Description('Description')); + + $this->assertSame('\DateTime Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Uses:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\FqsenResolver + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Fqsen + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $resolver = m::mock(FqsenResolver::class); + $context = new Context(''); + + $fqsen = new Fqsen('\DateTime'); + $description = new Description('My Description'); + + $descriptionFactory + ->shouldReceive('create')->with('My Description', $context)->andReturn($description) + ; + $resolver->shouldReceive('resolve')->with('DateTime', $context)->andReturn($fqsen); + + $fixture = Uses::create('DateTime My Description', $resolver, $descriptionFactory, $context); + + $this->assertSame('\DateTime My Description', (string)$fixture); + $this->assertSame($fqsen, $fixture->getReference()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + $this->assertNull(Uses::create([])); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotEmpty() + { + $this->assertNull(Uses::create('')); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + Uses::create('body'); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + Uses::create('body', new FqsenResolver()); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/VarTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/VarTest.php new file mode 100644 index 00000000..34f290ad --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/VarTest.php @@ -0,0 +1,200 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\TypeResolver; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\String_; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Var_ + * @covers :: + */ +class VarTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Var_('myVariable', null, new Description('Description')); + + $this->assertSame('var', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Var_('myVariable', new String_(), new Description('Description')); + $this->assertSame('@var string $myVariable Description', $fixture->render()); + + $fixture = new Var_('myVariable', null, new Description('Description')); + $this->assertSame('@var $myVariable Description', $fixture->render()); + + $fixture = new Var_('myVariable'); + $this->assertSame('@var $myVariable', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Var_('myVariable'); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getVariableName + */ + public function testHasVariableName() + { + $expected = 'myVariable'; + + $fixture = new Var_($expected); + + $this->assertSame($expected, $fixture->getVariableName()); + } + + /** + * @covers ::__construct + * @covers ::getType + */ + public function testHasType() + { + $expected = new String_(); + + $fixture = new Var_('myVariable', $expected); + + $this->assertSame($expected, $fixture->getType()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Var_('1.0', null, $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\String_ + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Var_('myVariable', new String_(), new Description('Description')); + + $this->assertSame('string $myVariable Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $typeResolver = new TypeResolver(); + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $description = new Description('My Description'); + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Var_::create('string $myVariable My Description', $typeResolver, $descriptionFactory, $context); + + $this->assertSame('string $myVariable My Description', (string)$fixture); + $this->assertSame('myVariable', $fixture->getVariableName()); + $this->assertInstanceOf(String_::class, $fixture->getType()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Var_:: + * @uses \phpDocumentor\Reflection\TypeResolver + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfEmptyBodyIsGiven() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + Var_::create('', new TypeResolver(), $descriptionFactory); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfBodyIsNotString() + { + Var_::create([]); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfResolverIsNull() + { + Var_::create('body'); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\TypeResolver + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfDescriptionFactoryIsNull() + { + Var_::create('body', new TypeResolver()); + } + + /** + * @covers ::__construct + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfVariableNameIsNotString() + { + new Var_([]); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/VersionTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/VersionTest.php new file mode 100644 index 00000000..5c487fd3 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlock/Tags/VersionTest.php @@ -0,0 +1,166 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\DocBlock\Tags; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\DocBlock\Tags\Version + * @covers :: + */ +class VersionTest extends \PHPUnit_Framework_TestCase +{ + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Version::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfCorrectTagNameIsReturned() + { + $fixture = new Version('1.0', new Description('Description')); + + $this->assertSame('version', $fixture->getName()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Version::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Version::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Formatter\PassthroughFormatter + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getName + */ + public function testIfTagCanBeRenderedUsingDefaultFormatter() + { + $fixture = new Version('1.0', new Description('Description')); + + $this->assertSame('@version 1.0 Description', $fixture->render()); + } + + /** + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Version::__construct + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::render + */ + public function testIfTagCanBeRenderedUsingSpecificFormatter() + { + $fixture = new Version('1.0', new Description('Description')); + + $formatter = m::mock(Formatter::class); + $formatter->shouldReceive('format')->with($fixture)->andReturn('Rendered output'); + + $this->assertSame('Rendered output', $fixture->render($formatter)); + } + + /** + * @covers ::__construct + * @covers ::getVersion + */ + public function testHasVersionNumber() + { + $expected = '1.0'; + + $fixture = new Version($expected); + + $this->assertSame($expected, $fixture->getVersion()); + } + + /** + * @covers ::__construct + * @covers \phpDocumentor\Reflection\DocBlock\Tags\BaseTag::getDescription + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testHasDescription() + { + $expected = new Description('Description'); + + $fixture = new Version('1.0', $expected); + + $this->assertSame($expected, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::__toString + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testStringRepresentationIsReturned() + { + $fixture = new Version('1.0', new Description('Description')); + + $this->assertSame('1.0 Description', (string)$fixture); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Version:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethod() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $context = new Context(''); + + $version = '1.0'; + $description = new Description('My Description'); + + $descriptionFactory->shouldReceive('create')->with('My Description', $context)->andReturn($description); + + $fixture = Version::create('1.0 My Description', $descriptionFactory, $context); + + $this->assertSame('1.0 My Description', (string)$fixture); + $this->assertSame($version, $fixture->getVersion()); + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::create + * @uses \phpDocumentor\Reflection\DocBlock\Tags\Version:: + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testFactoryMethodCreatesEmptyVersionTag() + { + $descriptionFactory = m::mock(DescriptionFactory::class); + $descriptionFactory->shouldReceive('create')->never(); + + $fixture = Version::create('', $descriptionFactory, new Context('')); + + $this->assertSame('', (string)$fixture); + $this->assertSame(null, $fixture->getVersion()); + $this->assertSame(null, $fixture->getDescription()); + } + + /** + * @covers ::create + * @expectedException \InvalidArgumentException + */ + public function testFactoryMethodFailsIfVersionIsNotString() + { + $this->assertNull(Version::create([])); + } + + /** + * @covers ::create + */ + public function testFactoryMethodReturnsNullIfBodyDoesNotMatchRegex() + { + $this->assertNull(Version::create('dkhf<')); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlockFactoryTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlockFactoryTest.php new file mode 100644 index 00000000..f1261b65 --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlockFactoryTest.php @@ -0,0 +1,290 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use Mockery as m; +use phpDocumentor\Reflection\DocBlock\Description; +use phpDocumentor\Reflection\DocBlock\DescriptionFactory; +use phpDocumentor\Reflection\DocBlock\Tag; +use phpDocumentor\Reflection\DocBlock\TagFactory; +use phpDocumentor\Reflection\DocBlock\Tags\Param; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass phpDocumentor\Reflection\DocBlockFactory + * @covers :: + * @uses \Webmozart\Assert\Assert + * @uses phpDocumentor\Reflection\DocBlock + */ +class DocBlockFactoryTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::__construct + * @covers ::createInstance + * @uses \phpDocumentor\Reflection\DocBlock\StandardTagFactory + * @uses \phpDocumentor\Reflection\DocBlock\DescriptionFactory + */ + public function testCreateFactoryUsingFactoryMethod() + { + $fixture = DocBlockFactory::createInstance(); + + $this->assertInstanceOf(DocBlockFactory::class, $fixture); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\Description + */ + public function testCreateDocBlockFromReflection() + { + $fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class)); + + $docBlock = '/** This is a DocBlock */'; + $classReflector = m::mock(\ReflectionClass::class); + $classReflector->shouldReceive('getDocComment')->andReturn($docBlock); + $docblock = $fixture->create($classReflector); + + $this->assertInstanceOf(DocBlock::class, $docblock); + $this->assertSame('This is a DocBlock', $docblock->getSummary()); + $this->assertEquals(new Description(''), $docblock->getDescription()); + $this->assertSame([], $docblock->getTags()); + $this->assertEquals(new Context(''), $docblock->getContext()); + $this->assertNull($docblock->getLocation()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\Description + */ + public function testCreateDocBlockFromStringWithDocComment() + { + $fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class)); + + $docblock = $fixture->create('/** This is a DocBlock */'); + + $this->assertInstanceOf(DocBlock::class, $docblock); + $this->assertSame('This is a DocBlock', $docblock->getSummary()); + $this->assertEquals(new Description(''), $docblock->getDescription()); + $this->assertSame([], $docblock->getTags()); + $this->assertEquals(new Context(''), $docblock->getContext()); + $this->assertNull($docblock->getLocation()); + } + + /** + * @covers ::create + * @covers ::__construct + * @uses phpDocumentor\Reflection\DocBlock\Description + */ + public function testCreateDocBlockFromStringWithoutDocComment() + { + $fixture = new DocBlockFactory(m::mock(DescriptionFactory::class), m::mock(TagFactory::class)); + + $docblock = $fixture->create('This is a DocBlock'); + + $this->assertInstanceOf(DocBlock::class, $docblock); + $this->assertSame('This is a DocBlock', $docblock->getSummary()); + $this->assertEquals(new Description(''), $docblock->getDescription()); + $this->assertSame([], $docblock->getTags()); + $this->assertEquals(new Context(''), $docblock->getContext()); + $this->assertNull($docblock->getLocation()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses phpDocumentor\Reflection\DocBlock\Description + * @dataProvider provideSummaryAndDescriptions + */ + public function testSummaryAndDescriptionAreSeparated($given, $summary, $description) + { + $tagFactory = m::mock(TagFactory::class); + $fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory); + + $docblock = $fixture->create($given); + + $this->assertSame($summary, $docblock->getSummary()); + $this->assertEquals(new Description($description), $docblock->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses phpDocumentor\Reflection\DocBlock\Description + */ + public function testDescriptionsRetainFormatting() + { + $tagFactory = m::mock(TagFactory::class); + $fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory); + + $given = <<create($given); + + $this->assertEquals(new Description($description), $docblock->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::create + * @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses phpDocumentor\Reflection\DocBlock\Description + */ + public function testTagsAreInterpretedUsingFactory() + { + $tagString = << This is with + multiline description. +TAG; + + $tag = m::mock(Tag::class); + $tagFactory = m::mock(TagFactory::class); + $tagFactory->shouldReceive('create')->with($tagString, m::type(Context::class))->andReturn($tag); + + $fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory); + + $given = << This is with + * multiline description. + */ +DOCBLOCK; + + $docblock = $fixture->create($given, new Context('')); + + $this->assertEquals([$tag], $docblock->getTags()); + } + + public function provideSummaryAndDescriptions() + { + return [ + ['This is a DocBlock', 'This is a DocBlock', ''], + [ + 'This is a DocBlock. This should still be summary.', + 'This is a DocBlock. This should still be summary.', + '' + ], + [ + <<shouldReceive('create')->with(m::any(), $context)->andReturn(new Param('param')); + $docblock = $fixture->create('/** @param MyType $param */', $context); + } + + /** + * @covers ::__construct + * @covers ::create + * + * @uses phpDocumentor\Reflection\DocBlock\DescriptionFactory + * @uses phpDocumentor\Reflection\DocBlock\Description + */ + public function testTagsAreFilteredForNullValues() + { + $tagString = << This is with + multiline description. +TAG; + + $tagFactory = m::mock(TagFactory::class); + $tagFactory->shouldReceive('create')->with($tagString, m::any())->andReturn(null); + + $fixture = new DocBlockFactory(new DescriptionFactory($tagFactory), $tagFactory); + + $given = << This is with + * multiline description. + */ +DOCBLOCK; + + $docblock = $fixture->create($given, new Context('')); + + $this->assertEquals([], $docblock->getTags()); + } +} diff --git a/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlockTest.php b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlockTest.php new file mode 100644 index 00000000..4a8d4ded --- /dev/null +++ b/vendor/phpdocumentor/reflection-docblock/tests/unit/DocBlockTest.php @@ -0,0 +1,252 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use Mockery as m; +use phpDocumentor\Reflection\Types\Context; + +/** + * @coversDefaultClass phpDocumentor\Reflection\DocBlock + * @covers :: + * @uses \Webmozart\Assert\Assert + */ +class DocBlockTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::__construct + * @covers ::getSummary + * + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testDocBlockCanHaveASummary() + { + $summary = 'This is a summary'; + + $fixture = new DocBlock($summary); + + $this->assertSame($summary, $fixture->getSummary()); + } + + /** + * @covers ::__construct + * + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfSummaryIsNotAString() + { + new DocBlock([]); + } + + /** + * @covers ::__construct + * + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfTemplateStartIsNotABoolean() + { + new DocBlock('', null, [], null, null, ['is not boolean']); + } + + /** + * @covers ::__construct + * + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfTemplateEndIsNotABoolean() + { + new DocBlock('', null, [], null, null, false, ['is not boolean']); + } + + /** + * @covers ::__construct + * @covers ::getDescription + * + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testDocBlockCanHaveADescription() + { + $description = new DocBlock\Description(''); + + $fixture = new DocBlock('', $description); + + $this->assertSame($description, $fixture->getDescription()); + } + + /** + * @covers ::__construct + * @covers ::getTags + * + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tag + */ + public function testDocBlockCanHaveTags() + { + $tags = [ + m::mock(DocBlock\Tag::class) + ]; + + $fixture = new DocBlock('', null, $tags); + + $this->assertSame($tags, $fixture->getTags()); + } + + /** + * @covers ::__construct + * @covers ::getTags + * + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tag + * + * @expectedException \InvalidArgumentException + */ + public function testDocBlockAllowsOnlyTags() + { + $tags = [ + null + ]; + + $fixture = new DocBlock('', null, $tags); + } + + /** + * @covers ::__construct + * @covers ::getTagsByName + * + * @uses \phpDocumentor\Reflection\DocBlock::getTags + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tag + */ + public function testFindTagsInDocBlockByName() + { + $tag1 = m::mock(DocBlock\Tag::class); + $tag2 = m::mock(DocBlock\Tag::class); + $tag3 = m::mock(DocBlock\Tag::class); + $tags = [$tag1, $tag2, $tag3]; + + $tag1->shouldReceive('getName')->andReturn('abc'); + $tag2->shouldReceive('getName')->andReturn('abcd'); + $tag3->shouldReceive('getName')->andReturn('ab'); + + $fixture = new DocBlock('', null, $tags); + + $this->assertSame([$tag2], $fixture->getTagsByName('abcd')); + $this->assertSame([], $fixture->getTagsByName('Ebcd')); + } + + /** + * @covers ::__construct + * @covers ::getTagsByName + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfNameForTagsIsNotString() + { + $fixture = new DocBlock(); + $fixture->getTagsByName([]); + } + + /** + * @covers ::__construct + * @covers ::hasTag + * + * @uses \phpDocumentor\Reflection\DocBlock::getTags + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\DocBlock\Tag + */ + public function testCheckIfThereAreTagsWithAGivenName() + { + $tag1 = m::mock(DocBlock\Tag::class); + $tag2 = m::mock(DocBlock\Tag::class); + $tag3 = m::mock(DocBlock\Tag::class); + $tags = [$tag1, $tag2, $tag3]; + + $tag1->shouldReceive('getName')->twice()->andReturn('abc'); + $tag2->shouldReceive('getName')->twice()->andReturn('abcd'); + $tag3->shouldReceive('getName')->once(); + + $fixture = new DocBlock('', null, $tags); + + $this->assertTrue($fixture->hasTag('abcd')); + $this->assertFalse($fixture->hasTag('Ebcd')); + } + + /** + * @covers ::__construct + * @covers ::hasTag + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfNameForCheckingTagsIsNotString() + { + $fixture = new DocBlock(); + $fixture->hasTag([]); + } + + /** + * @covers ::__construct + * @covers ::getContext + * + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Types\Context + */ + public function testDocBlockKnowsInWhichNamespaceItIsAndWhichAliasesThereAre() + { + $context = new Context(''); + + $fixture = new DocBlock('', null, [], $context); + + $this->assertSame($context, $fixture->getContext()); + } + + /** + * @covers ::__construct + * @covers ::getLocation + * + * @uses \phpDocumentor\Reflection\DocBlock\Description + * @uses \phpDocumentor\Reflection\Location + */ + public function testDocBlockKnowsAtWhichLineItIs() + { + $location = new Location(10); + + $fixture = new DocBlock('', null, [], null, $location); + + $this->assertSame($location, $fixture->getLocation()); + } + + /** + * @covers ::__construct + * @covers ::isTemplateStart + * + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testDocBlockKnowsIfItIsTheStartOfADocBlockTemplate() + { + $fixture = new DocBlock('', null, [], null, null, true); + + $this->assertTrue($fixture->isTemplateStart()); + } + + /** + * @covers ::__construct + * @covers ::isTemplateEnd + * + * @uses \phpDocumentor\Reflection\DocBlock\Description + */ + public function testDocBlockKnowsIfItIsTheEndOfADocBlockTemplate() + { + $fixture = new DocBlock('', null, [], null, null, false, true); + + $this->assertTrue($fixture->isTemplateEnd()); + } +} diff --git a/vendor/phpdocumentor/type-resolver/.gitignore b/vendor/phpdocumentor/type-resolver/.gitignore new file mode 100644 index 00000000..82cfc4e9 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/.gitignore @@ -0,0 +1,3 @@ +.idea +composer.lock +vendor diff --git a/vendor/phpdocumentor/type-resolver/.scrutinizer.yml b/vendor/phpdocumentor/type-resolver/.scrutinizer.yml new file mode 100644 index 00000000..7d7372a8 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/.scrutinizer.yml @@ -0,0 +1,31 @@ +before_commands: + - "composer install --no-dev --prefer-source" + +tools: + external_code_coverage: true + php_code_sniffer: + config: + standard: PSR2 + filter: + paths: ["src/*", "tests/*"] + php_cpd: + enabled: true + excluded_dirs: ["tests", "vendor"] + php_loc: + enabled: true + excluded_dirs: ["tests", "vendor"] + php_mess_detector: + enabled: true + config: + ruleset: phpmd.xml.dist + design_rules: { eval_expression: false } + filter: + paths: ["src/*"] + php_pdepend: + enabled: true + excluded_dirs: ["tests", "vendor"] + php_analyzer: + enabled: true + filter: + paths: ["src/*", "tests/*"] + sensiolabs_security_checker: true diff --git a/vendor/phpdocumentor/type-resolver/.travis.yml b/vendor/phpdocumentor/type-resolver/.travis.yml new file mode 100644 index 00000000..c882b141 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/.travis.yml @@ -0,0 +1,34 @@ +language: php +php: + - 5.5 + - 5.6 + - 7.0 + - hhvm + - nightly + +matrix: + allow_failures: + - php: + - hhvm + - nightly + +cache: + directories: + - $HOME/.composer/cache + +script: + - vendor/bin/phpunit --coverage-clover=coverage.clover -v + - composer update --no-interaction --prefer-source + - vendor/bin/phpunit -v + +before_script: + - composer install --no-interaction + +after_script: + - if [ $TRAVIS_PHP_VERSION = '5.6' ]; then wget https://scrutinizer-ci.com/ocular.phar; php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi + +notifications: + irc: "irc.freenode.org#phpdocumentor" + email: + - me@mikevanriel.com + - ashnazg@php.net diff --git a/vendor/phpdocumentor/type-resolver/LICENSE b/vendor/phpdocumentor/type-resolver/LICENSE new file mode 100644 index 00000000..792e4040 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2010 Mike van Riel + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/vendor/phpdocumentor/type-resolver/README.md b/vendor/phpdocumentor/type-resolver/README.md new file mode 100644 index 00000000..ca8147bc --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/README.md @@ -0,0 +1,169 @@ +TypeResolver and FqsenResolver +============================== + +The specification on types in DocBlocks (PSR-5) describes various keywords and special constructs +but also how to statically resolve the partial name of a Class into a Fully Qualified Class Name (FQCN). + +PSR-5 also introduces an additional way to describe deeper elements than Classes, Interfaces and Traits +called the Fully Qualified Structural Element Name (FQSEN). Using this it is possible to refer to methods, +properties and class constants but also functions and global constants. + +This package provides two Resolvers that are capable of + +1. Returning a series of Value Object for given expression while resolving any partial class names, and +2. Returning an FQSEN object after resolving any partial Structural Element Names into Fully Qualified Structural + Element names. + +## Installing + +The easiest way to install this library is with [Composer](https://getcomposer.org) using the following command: + + $ composer require phpdocumentor/type-resolver + +## Examples + +Ready to dive in and don't want to read through all that text below? Just consult the [examples](examples) folder and +check which type of action that your want to accomplish. + +## On Types and Element Names + +This component can be used in one of two ways + +1. To resolve a Type or +2. To resolve a Fully Qualified Structural Element Name + +The big difference between these two is in the number of things it can resolve. + +The TypeResolver can resolve: + +- a php primitive or pseudo-primitive such as a string or void (`@var string` or `@return void`). +- a composite such as an array of string (`@var string[]`). +- a compound such as a string or integer (`@var string|integer`). +- an object or interface such as the TypeResolver class (`@var TypeResolver` + or `@var \phpDocumentor\Reflection\TypeResolver`) + + > please note that if you want to pass partial class names that additional steps are necessary, see the + > chapter `Resolving partial classes and FQSENs` for more information. + +Where the FqsenResolver can resolve: + +- Constant expressions (i.e. `@see \MyNamespace\MY_CONSTANT`) +- Function expressions (i.e. `@see \MyNamespace\myFunction()`) +- Class expressions (i.e. `@see \MyNamespace\MyClass`) +- Interface expressions (i.e. `@see \MyNamespace\MyInterface`) +- Trait expressions (i.e. `@see \MyNamespace\MyTrait`) +- Class constant expressions (i.e. `@see \MyNamespace\MyClass::MY_CONSTANT`) +- Property expressions (i.e. `@see \MyNamespace\MyClass::$myProperty`) +- Method expressions (i.e. `@see \MyNamespace\MyClass::myMethod()`) + +## Resolving a type + +In order to resolve a type you will have to instantiate the class `\phpDocumentor\Reflection\TypeResolver` +and call its `resolve` method like this: + + $typeResolver = new \phpDocumentor\Reflection\TypeResolver(); + $type = $typeResolver->resolve('string|integer'); + +In this example you will receive a Value Object of class `\phpDocumentor\Reflection\Types\Compound` that has two +elements, one of type `\phpDocumentor\Reflection\Types\String_` and one of type +`\phpDocumentor\Reflection\Types\Integer`. + +The real power of this resolver is in its capability to expand partial class names into fully qualified class names; but +in order to do that we need an additional `\phpDocumentor\Reflection\Types\Context` class that will inform the resolver +in which namespace the given expression occurs and which namespace aliases (or imports) apply. + +## Resolving an FQSEN + +A Fully Qualified Structural Element Name is a reference to another element in your code bases and can be resolved using +the `\phpDocumentor\Reflection\FqsenResolver` class' `resolve` method, like this: + + $fqsenResolver = new \phpDocumentor\Reflection\FqsenResolver(); + $fqsen = $fqsenResolver->resolve('\phpDocumentor\Reflection\FqsenResolver::resolve()'); + +In this example we resolve a Fully Qualified Structural Element Name (meaning that it includes the full namespace, class +name and element name) and receive a Value Object of type `\phpDocumentor\Reflection\Fqsen`. + +The real power of this resolver is in its capability to expand partial element names into Fully Qualified Structural +Element Names; but in order to do that we need an additional `\phpDocumentor\Reflection\Types\Context` class that will +inform the resolver in which namespace the given expression occurs and which namespace aliases (or imports) apply. + +## Resolving partial Classes and Structural Element Names + +Perhaps the best feature of this library is that it knows how to resolve partial class names into fully qualified class +names. + +For example, you have this file: + +```php + '\phpDocumentor\Reflection\Types'] + ); + +Or by using the `\phpDocumentor\Reflection\Types\ContextFactory` to instantiate a new context based on a Reflector +object or by providing the namespace that you'd like to extract and the source code of the file in which the given +type expression occurs. + + $contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); + $context = $contextFactory->createFromReflector(new ReflectionMethod('\My\Example\Classy', '__construct')); + +or + + $contextFactory = new \phpDocumentor\Reflection\Types\ContextFactory(); + $context = $contextFactory->createForNamespace('\My\Example', file_get_contents('My/Example/Classy.php')); + +### Using the Context + +After you have obtained a Context it is just a matter of passing it along with the `resolve` method of either Resolver +class as second argument and the Resolvers will take this into account when resolving partial names. + +To obtain the resolved class name for the `@var` tag in the example above you can do: + + $typeResolver = new \phpDocumentor\Reflection\TypeResolver(); + $type = $typeResolver->resolve('Types\Context', $context); + +When you do this you will receive an object of class `\phpDocumentor\Reflection\Types\Object_` for which you can call +the `getFqsen` method to receive a Value Object that represents the complete FQSEN. So that would be +`phpDocumentor\Reflection\Types\Context`. + +> Why is the FQSEN wrapped in another object `Object_`? +> +> The resolve method of the TypeResolver only returns object with the interface `Type` and the FQSEN is a common +> type that does not represent a Type. Also: in some cases a type can represent an "Untyped Object", meaning that it +> is an object (signified by the `object` keyword) but does not refer to a specific element using an FQSEN. + +Another example is on how to resolve the FQSEN of a method as can be seen with the `@see` tag in the example above. To +resolve that you can do the following: + + $fqsenResolver = new \phpDocumentor\Reflection\FqsenResolver(); + $type = $fqsenResolver->resolve('Classy::otherFunction()', $context); + +Because Classy is a Class in the current namespace its FQSEN will have the `My\Example` namespace and by calling the +`resolve` method of the FQSEN Resolver you will receive an `Fqsen` object that refers to +`\My\Example\Classy::otherFunction()`. diff --git a/vendor/phpdocumentor/type-resolver/composer.json b/vendor/phpdocumentor/type-resolver/composer.json new file mode 100644 index 00000000..abaa965d --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/composer.json @@ -0,0 +1,27 @@ +{ + "name": "phpdocumentor/type-resolver", + "type": "library", + "license": "MIT", + "authors": [ + {"name": "Mike van Riel", "email": "me@mikevanriel.com"} + ], + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0" + }, + "autoload": { + "psr-4": {"phpDocumentor\\Reflection\\": ["src/"]} + }, + "autoload-dev": { + "psr-4": {"phpDocumentor\\Reflection\\": ["tests/unit"]} + }, + "require-dev": { + "phpunit/phpunit": "^5.2||^4.8.24", + "mockery/mockery": "^0.9.4" + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/vendor/phpdocumentor/type-resolver/examples/01-resolving-simple-types.php b/vendor/phpdocumentor/type-resolver/examples/01-resolving-simple-types.php new file mode 100644 index 00000000..682b1d3d --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/examples/01-resolving-simple-types.php @@ -0,0 +1,13 @@ +resolve('string|integer')); + +// Will return the string "string|int" +var_dump((string)$typeResolver->resolve('string|integer')); diff --git a/vendor/phpdocumentor/type-resolver/examples/02-resolving-classes.php b/vendor/phpdocumentor/type-resolver/examples/02-resolving-classes.php new file mode 100644 index 00000000..70aa5e42 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/examples/02-resolving-classes.php @@ -0,0 +1,12 @@ + 'Mockery' ]); +var_dump((string)$typeResolver->resolve('Types\Resolver|m\MockInterface', $context)); diff --git a/vendor/phpdocumentor/type-resolver/examples/03-resolving-all-elements.php b/vendor/phpdocumentor/type-resolver/examples/03-resolving-all-elements.php new file mode 100644 index 00000000..4f4282eb --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/examples/03-resolving-all-elements.php @@ -0,0 +1,17 @@ +resolve('Types\Resolver::resolveFqsen()', $context)); + +// Property named: \phpDocumentor\Types\Types\Resolver::$keyWords +var_dump((string)$fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); diff --git a/vendor/phpdocumentor/type-resolver/examples/04-discovering-the-context-using-class-reflection.php b/vendor/phpdocumentor/type-resolver/examples/04-discovering-the-context-using-class-reflection.php new file mode 100644 index 00000000..957c97dd --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/examples/04-discovering-the-context-using-class-reflection.php @@ -0,0 +1,30 @@ +createFromReflector(new ReflectionClass('My\\Example\\Classy')); + +// Class named: \phpDocumentor\Reflection\Types\Resolver +var_dump((string)$typeResolver->resolve('Types\Resolver', $context)); + +// String +var_dump((string)$typeResolver->resolve('string', $context)); + +// Property named: \phpDocumentor\Reflection\Types\Resolver::$keyWords +var_dump((string)$fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); + +// Class named: \My\Example\string +// - Shows the difference between the FqsenResolver and TypeResolver; the FqsenResolver will assume +// that the given value is not a type but most definitely a reference to another element. This is +// because conflicts between type keywords and class names can exist and if you know a reference +// is not a type but an element you can force that keywords are resolved. +var_dump((string)$fqsenResolver->resolve('string', $context)); diff --git a/vendor/phpdocumentor/type-resolver/examples/05-discovering-the-context-using-method-reflection.php b/vendor/phpdocumentor/type-resolver/examples/05-discovering-the-context-using-method-reflection.php new file mode 100644 index 00000000..10c0c883 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/examples/05-discovering-the-context-using-method-reflection.php @@ -0,0 +1,30 @@ +createFromReflector(new ReflectionMethod('My\\Example\\Classy', '__construct')); + +// Class named: \phpDocumentor\Reflection\Types\Resolver +var_dump((string)$typeResolver->resolve('Types\Resolver', $context)); + +// String +var_dump((string)$typeResolver->resolve('string', $context)); + +// Property named: \phpDocumentor\Reflection\Types\Resolver::$keyWords +var_dump((string)$fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); + +// Class named: \My\Example\string +// - Shows the difference between the FqsenResolver and TypeResolver; the FqsenResolver will assume +// that the given value is not a type but most definitely a reference to another element. This is +// because conflicts between type keywords and class names can exist and if you know a reference +// is not a type but an element you can force that keywords are resolved. +var_dump((string)$fqsenResolver->resolve('string', $context)); diff --git a/vendor/phpdocumentor/type-resolver/examples/06-discovering-the-context-using-file-contents.php b/vendor/phpdocumentor/type-resolver/examples/06-discovering-the-context-using-file-contents.php new file mode 100644 index 00000000..a93728c8 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/examples/06-discovering-the-context-using-file-contents.php @@ -0,0 +1,22 @@ +createForNamespace('My\Example', file_get_contents('Classy.php')); + +// Class named: \phpDocumentor\Reflection\Types\Resolver +var_dump((string)$typeResolver->resolve('Types\Resolver', $context)); + +// String +var_dump((string)$typeResolver->resolve('string', $context)); + +// Property named: \phpDocumentor\Reflection\Types\Resolver::$keyWords +var_dump((string)$fqsenResolver->resolve('Types\Resolver::$keyWords', $context)); diff --git a/vendor/phpdocumentor/type-resolver/examples/Classy.php b/vendor/phpdocumentor/type-resolver/examples/Classy.php new file mode 100644 index 00000000..0705266f --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/examples/Classy.php @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + 40 + + + diff --git a/vendor/phpdocumentor/type-resolver/phpunit.xml.dist b/vendor/phpdocumentor/type-resolver/phpunit.xml.dist new file mode 100644 index 00000000..3246bef4 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/phpunit.xml.dist @@ -0,0 +1,31 @@ + + + + + + ./tests/unit + + + + + ./src/ + + + ./examples/ + ./vendor/ + + + + + + diff --git a/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php b/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php new file mode 100644 index 00000000..a0e0041c --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/FqsenResolver.php @@ -0,0 +1,76 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\Types\Context; + +class FqsenResolver +{ + /** @var string Definition of the NAMESPACE operator in PHP */ + const OPERATOR_NAMESPACE = '\\'; + + public function resolve($fqsen, Context $context = null) + { + if ($context === null) { + $context = new Context(''); + } + + if ($this->isFqsen($fqsen)) { + return new Fqsen($fqsen); + } + + return $this->resolvePartialStructuralElementName($fqsen, $context); + } + + /** + * Tests whether the given type is a Fully Qualified Structural Element Name. + * + * @param string $type + * + * @return bool + */ + private function isFqsen($type) + { + return strpos($type, self::OPERATOR_NAMESPACE) === 0; + } + + /** + * Resolves a partial Structural Element Name (i.e. `Reflection\DocBlock`) to its FQSEN representation + * (i.e. `\phpDocumentor\Reflection\DocBlock`) based on the Namespace and aliases mentioned in the Context. + * + * @param string $type + * @param Context $context + * + * @return Fqsen + */ + private function resolvePartialStructuralElementName($type, Context $context) + { + $typeParts = explode(self::OPERATOR_NAMESPACE, $type, 2); + + $namespaceAliases = $context->getNamespaceAliases(); + + // if the first segment is not an alias; prepend namespace name and return + if (!isset($namespaceAliases[$typeParts[0]])) { + $namespace = $context->getNamespace(); + if ('' !== $namespace) { + $namespace .= self::OPERATOR_NAMESPACE; + } + + return new Fqsen(self::OPERATOR_NAMESPACE . $namespace . $type); + } + + $typeParts[0] = $namespaceAliases[$typeParts[0]]; + + return new Fqsen(self::OPERATOR_NAMESPACE . implode(self::OPERATOR_NAMESPACE, $typeParts)); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Type.php b/vendor/phpdocumentor/type-resolver/src/Type.php new file mode 100644 index 00000000..33ca5595 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Type.php @@ -0,0 +1,18 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +interface Type +{ + public function __toString(); +} diff --git a/vendor/phpdocumentor/type-resolver/src/TypeResolver.php b/vendor/phpdocumentor/type-resolver/src/TypeResolver.php new file mode 100644 index 00000000..3a68a4d3 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/TypeResolver.php @@ -0,0 +1,266 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use phpDocumentor\Reflection\Types\Array_; +use phpDocumentor\Reflection\Types\Compound; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Object_; + +final class TypeResolver +{ + /** @var string Definition of the ARRAY operator for types */ + const OPERATOR_ARRAY = '[]'; + + /** @var string Definition of the NAMESPACE operator in PHP */ + const OPERATOR_NAMESPACE = '\\'; + + /** @var string[] List of recognized keywords and unto which Value Object they map */ + private $keywords = array( + 'string' => 'phpDocumentor\Reflection\Types\String_', + 'int' => 'phpDocumentor\Reflection\Types\Integer', + 'integer' => 'phpDocumentor\Reflection\Types\Integer', + 'bool' => 'phpDocumentor\Reflection\Types\Boolean', + 'boolean' => 'phpDocumentor\Reflection\Types\Boolean', + 'float' => 'phpDocumentor\Reflection\Types\Float_', + 'double' => 'phpDocumentor\Reflection\Types\Float_', + 'object' => 'phpDocumentor\Reflection\Types\Object_', + 'mixed' => 'phpDocumentor\Reflection\Types\Mixed', + 'array' => 'phpDocumentor\Reflection\Types\Array_', + 'resource' => 'phpDocumentor\Reflection\Types\Resource', + 'void' => 'phpDocumentor\Reflection\Types\Void_', + 'null' => 'phpDocumentor\Reflection\Types\Null_', + 'scalar' => 'phpDocumentor\Reflection\Types\Scalar', + 'callback' => 'phpDocumentor\Reflection\Types\Callable_', + 'callable' => 'phpDocumentor\Reflection\Types\Callable_', + 'false' => 'phpDocumentor\Reflection\Types\Boolean', + 'true' => 'phpDocumentor\Reflection\Types\Boolean', + 'self' => 'phpDocumentor\Reflection\Types\Self_', + '$this' => 'phpDocumentor\Reflection\Types\This', + 'static' => 'phpDocumentor\Reflection\Types\Static_' + ); + + /** @var FqsenResolver */ + private $fqsenResolver; + + /** + * Initializes this TypeResolver with the means to create and resolve Fqsen objects. + * + * @param FqsenResolver $fqsenResolver + */ + public function __construct(FqsenResolver $fqsenResolver = null) + { + $this->fqsenResolver = $fqsenResolver ?: new FqsenResolver(); + } + + /** + * Analyzes the given type and returns the FQCN variant. + * + * When a type is provided this method checks whether it is not a keyword or + * Fully Qualified Class Name. If so it will use the given namespace and + * aliases to expand the type to a FQCN representation. + * + * This method only works as expected if the namespace and aliases are set; + * no dynamic reflection is being performed here. + * + * @param string $type The relative or absolute type. + * @param Context $context + * + * @uses Context::getNamespace() to determine with what to prefix the type name. + * @uses Context::getNamespaceAliases() to check whether the first part of the relative type name should not be + * replaced with another namespace. + * + * @return Type|null + */ + public function resolve($type, Context $context = null) + { + if (!is_string($type)) { + throw new \InvalidArgumentException( + 'Attempted to resolve type but it appeared not to be a string, received: ' . var_export($type, true) + ); + } + + $type = trim($type); + if (!$type) { + throw new \InvalidArgumentException('Attempted to resolve "' . $type . '" but it appears to be empty'); + } + + if ($context === null) { + $context = new Context(''); + } + + switch (true) { + case $this->isKeyword($type): + return $this->resolveKeyword($type); + case ($this->isCompoundType($type)): + return $this->resolveCompoundType($type, $context); + case $this->isTypedArray($type): + return $this->resolveTypedArray($type, $context); + case $this->isFqsen($type): + return $this->resolveTypedObject($type); + case $this->isPartialStructuralElementName($type): + return $this->resolveTypedObject($type, $context); + // @codeCoverageIgnoreStart + default: + // I haven't got the foggiest how the logic would come here but added this as a defense. + throw new \RuntimeException( + 'Unable to resolve type "' . $type . '", there is no known method to resolve it' + ); + } + // @codeCoverageIgnoreEnd + } + + /** + * Adds a keyword to the list of Keywords and associates it with a specific Value Object. + * + * @param string $keyword + * @param string $typeClassName + * + * @return void + */ + public function addKeyword($keyword, $typeClassName) + { + if (!class_exists($typeClassName)) { + throw new \InvalidArgumentException( + 'The Value Object that needs to be created with a keyword "' . $keyword . '" must be an existing class' + . ' but we could not find the class ' . $typeClassName + ); + } + + if (!in_array(Type::class, class_implements($typeClassName))) { + throw new \InvalidArgumentException( + 'The class "' . $typeClassName . '" must implement the interface "phpDocumentor\Reflection\Type"' + ); + } + + $this->keywords[$keyword] = $typeClassName; + } + + /** + * Detects whether the given type represents an array. + * + * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. + * + * @return bool + */ + private function isTypedArray($type) + { + return substr($type, -2) === self::OPERATOR_ARRAY; + } + + /** + * Detects whether the given type represents a PHPDoc keyword. + * + * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. + * + * @return bool + */ + private function isKeyword($type) + { + return in_array(strtolower($type), array_keys($this->keywords), true); + } + + /** + * Detects whether the given type represents a relative structural element name. + * + * @param string $type A relative or absolute type as defined in the phpDocumentor documentation. + * + * @return bool + */ + private function isPartialStructuralElementName($type) + { + return ($type[0] !== self::OPERATOR_NAMESPACE) && !$this->isKeyword($type); + } + + /** + * Tests whether the given type is a Fully Qualified Structural Element Name. + * + * @param string $type + * + * @return bool + */ + private function isFqsen($type) + { + return strpos($type, self::OPERATOR_NAMESPACE) === 0; + } + + /** + * Tests whether the given type is a compound type (i.e. `string|int`). + * + * @param string $type + * + * @return bool + */ + private function isCompoundType($type) + { + return strpos($type, '|') !== false; + } + + /** + * Resolves the given typed array string (i.e. `string[]`) into an Array object with the right types set. + * + * @param string $type + * @param Context $context + * + * @return Array_ + */ + private function resolveTypedArray($type, Context $context) + { + return new Array_($this->resolve(substr($type, 0, -2), $context)); + } + + /** + * Resolves the given keyword (such as `string`) into a Type object representing that keyword. + * + * @param string $type + * + * @return Type + */ + private function resolveKeyword($type) + { + $className = $this->keywords[strtolower($type)]; + + return new $className(); + } + + /** + * Resolves the given FQSEN string into an FQSEN object. + * + * @param string $type + * + * @return Object_ + */ + private function resolveTypedObject($type, Context $context = null) + { + return new Object_($this->fqsenResolver->resolve($type, $context)); + } + + /** + * Resolves a compound type (i.e. `string|int`) into the appropriate Type objects or FQSEN. + * + * @param string $type + * @param Context $context + * + * @return Compound + */ + private function resolveCompoundType($type, Context $context) + { + $types = []; + + foreach (explode('|', $type) as $part) { + $types[] = $this->resolve($part, $context); + } + + return new Compound($types); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Array_.php b/vendor/phpdocumentor/type-resolver/src/Types/Array_.php new file mode 100644 index 00000000..45276c6b --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Array_.php @@ -0,0 +1,87 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\Type; + +/** + * Represents an array type as described in the PSR-5, the PHPDoc Standard. + * + * An array can be represented in two forms: + * + * 1. Untyped (`array`), where the key and value type is unknown and hence classified as 'Mixed'. + * 2. Types (`string[]`), where the value type is provided by preceding an opening and closing square bracket with a + * type name. + */ +final class Array_ implements Type +{ + /** @var Type */ + private $valueType; + + /** @var Type */ + private $keyType; + + /** + * Initializes this representation of an array with the given Type or Fqsen. + * + * @param Type $valueType + * @param Type $keyType + */ + public function __construct(Type $valueType = null, Type $keyType = null) + { + if ($keyType === null) { + $keyType = new Compound([ new String_(), new Integer() ]); + } + if ($valueType === null) { + $valueType = new Mixed(); + } + + $this->valueType = $valueType; + $this->keyType = $keyType; + } + + /** + * Returns the type for the keys of this array. + * + * @return Type + */ + public function getKeyType() + { + return $this->keyType; + } + + /** + * Returns the value for the keys of this array. + * + * @return Type + */ + public function getValueType() + { + return $this->valueType; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + if ($this->valueType instanceof Mixed) { + return 'array'; + } + + return $this->valueType . '[]'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Boolean.php b/vendor/phpdocumentor/type-resolver/src/Types/Boolean.php new file mode 100644 index 00000000..f82b19e5 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Boolean.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a Boolean type. + */ +final class Boolean implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'bool'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Callable_.php b/vendor/phpdocumentor/type-resolver/src/Types/Callable_.php new file mode 100644 index 00000000..68ebfbd0 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Callable_.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a Callable type. + */ +final class Callable_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'callable'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Compound.php b/vendor/phpdocumentor/type-resolver/src/Types/Compound.php new file mode 100644 index 00000000..3e5ebb5c --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Compound.php @@ -0,0 +1,82 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a Compound Type. + * + * A Compound Type is not so much a special keyword or object reference but is a series of Types that are separated + * using an OR operator (`|`). This combination of types signifies that whatever is associated with this compound type + * may contain a value with any of the given types. + */ +final class Compound implements Type +{ + /** @var Type[] */ + private $types = []; + + /** + * Initializes a compound type (i.e. `string|int`) and tests if the provided types all implement the Type interface. + * + * @param Type[] $types + */ + public function __construct(array $types) + { + foreach ($types as $type) { + if (!$type instanceof Type) { + throw new \InvalidArgumentException('A compound type can only have other types as elements'); + } + } + + $this->types = $types; + } + + /** + * Returns the type at the given index. + * + * @param integer $index + * + * @return Type|null + */ + public function get($index) + { + if (!$this->has($index)) { + return null; + } + + return $this->types[$index]; + } + + /** + * Tests if this compound type has a type with the given index. + * + * @param integer $index + * + * @return bool + */ + public function has($index) + { + return isset($this->types[$index]); + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return implode('|', $this->types); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Context.php b/vendor/phpdocumentor/type-resolver/src/Types/Context.php new file mode 100644 index 00000000..b4aa8f21 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Context.php @@ -0,0 +1,84 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +/** + * Provides information about the Context in which the DocBlock occurs that receives this context. + * + * A DocBlock does not know of its own accord in which namespace it occurs and which namespace aliases are applicable + * for the block of code in which it is in. This information is however necessary to resolve Class names in tags since + * you can provide a short form or make use of namespace aliases. + * + * The phpDocumentor Reflection component knows how to create this class but if you use the DocBlock parser from your + * own application it is possible to generate a Context class using the ContextFactory; this will analyze the file in + * which an associated class resides for its namespace and imports. + * + * @see ContextFactory::createFromClassReflector() + * @see ContextFactory::createForNamespace() + */ +final class Context +{ + /** @var string The current namespace. */ + private $namespace = ''; + + /** @var array List of namespace aliases => Fully Qualified Namespace. */ + private $namespaceAliases = []; + + /** + * Initializes the new context and normalizes all passed namespaces to be in Qualified Namespace Name (QNN) + * format (without a preceding `\`). + * + * @param string $namespace The namespace where this DocBlock resides in. + * @param array $namespaceAliases List of namespace aliases => Fully Qualified Namespace. + */ + public function __construct($namespace, array $namespaceAliases = []) + { + $this->namespace = ('global' !== $namespace && 'default' !== $namespace) + ? trim((string)$namespace, '\\') + : ''; + + foreach ($namespaceAliases as $alias => $fqnn) { + if ($fqnn[0] === '\\') { + $fqnn = substr($fqnn, 1); + } + if ($fqnn[count($fqnn)-1] === '\\') { + $fqnn = substr($fqnn, 0, -1); + } + + $namespaceAliases[$alias] = $fqnn; + } + + $this->namespaceAliases = $namespaceAliases; + } + + /** + * Returns the Qualified Namespace Name (thus without `\` in front) where the associated element is in. + * + * @return string + */ + public function getNamespace() + { + return $this->namespace; + } + + /** + * Returns a list of Qualified Namespace Names (thus without `\` in front) that are imported, the keys represent + * the alias for the imported Namespace. + * + * @return string[] + */ + public function getNamespaceAliases() + { + return $this->namespaceAliases; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php new file mode 100644 index 00000000..147df694 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/ContextFactory.php @@ -0,0 +1,210 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +/** + * Convenience class to create a Context for DocBlocks when not using the Reflection Component of phpDocumentor. + * + * For a DocBlock to be able to resolve types that use partial namespace names or rely on namespace imports we need to + * provide a bit of context so that the DocBlock can read that and based on it decide how to resolve the types to + * Fully Qualified names. + * + * @see Context for more information. + */ +final class ContextFactory +{ + /** The literal used at the end of a use statement. */ + const T_LITERAL_END_OF_USE = ';'; + + /** The literal used between sets of use statements */ + const T_LITERAL_USE_SEPARATOR = ','; + + /** + * Build a Context given a Class Reflection. + * + * @param \ReflectionClass $reflector + * + * @see Context for more information on Contexts. + * + * @return Context + */ + public function createFromReflector(\Reflector $reflector) + { + if (method_exists($reflector, 'getDeclaringClass')) { + $reflector = $reflector->getDeclaringClass(); + } + + $fileName = $reflector->getFileName(); + $namespace = $reflector->getNamespaceName(); + + if (file_exists($fileName)) { + return $this->createForNamespace($namespace, file_get_contents($fileName)); + } + + return new Context($namespace, []); + } + + /** + * Build a Context for a namespace in the provided file contents. + * + * @param string $namespace It does not matter if a `\` precedes the namespace name, this method first normalizes. + * @param string $fileContents the file's contents to retrieve the aliases from with the given namespace. + * + * @see Context for more information on Contexts. + * + * @return Context + */ + public function createForNamespace($namespace, $fileContents) + { + $namespace = trim($namespace, '\\'); + $useStatements = []; + $currentNamespace = ''; + $tokens = new \ArrayIterator(token_get_all($fileContents)); + + while ($tokens->valid()) { + switch ($tokens->current()[0]) { + case T_NAMESPACE: + $currentNamespace = $this->parseNamespace($tokens); + break; + case T_CLASS: + // Fast-forward the iterator through the class so that any + // T_USE tokens found within are skipped - these are not + // valid namespace use statements so should be ignored. + $braceLevel = 0; + $firstBraceFound = false; + while ($tokens->valid() && ($braceLevel > 0 || !$firstBraceFound)) { + if ($tokens->current() === '{' + || $tokens->current()[0] === T_CURLY_OPEN + || $tokens->current()[0] === T_DOLLAR_OPEN_CURLY_BRACES) { + if (!$firstBraceFound) { + $firstBraceFound = true; + } + $braceLevel++; + } + + if ($tokens->current() === '}') { + $braceLevel--; + } + $tokens->next(); + } + break; + case T_USE: + if ($currentNamespace === $namespace) { + $useStatements = array_merge($useStatements, $this->parseUseStatement($tokens)); + } + break; + } + $tokens->next(); + } + + return new Context($namespace, $useStatements); + } + + /** + * Deduce the name from tokens when we are at the T_NAMESPACE token. + * + * @param \ArrayIterator $tokens + * + * @return string + */ + private function parseNamespace(\ArrayIterator $tokens) + { + // skip to the first string or namespace separator + $this->skipToNextStringOrNamespaceSeparator($tokens); + + $name = ''; + while ($tokens->valid() && ($tokens->current()[0] === T_STRING || $tokens->current()[0] === T_NS_SEPARATOR) + ) { + $name .= $tokens->current()[1]; + $tokens->next(); + } + + return $name; + } + + /** + * Deduce the names of all imports when we are at the T_USE token. + * + * @param \ArrayIterator $tokens + * + * @return string[] + */ + private function parseUseStatement(\ArrayIterator $tokens) + { + $uses = []; + $continue = true; + + while ($continue) { + $this->skipToNextStringOrNamespaceSeparator($tokens); + + list($alias, $fqnn) = $this->extractUseStatement($tokens); + $uses[$alias] = $fqnn; + if ($tokens->current()[0] === self::T_LITERAL_END_OF_USE) { + $continue = false; + } + } + + return $uses; + } + + /** + * Fast-forwards the iterator as longs as we don't encounter a T_STRING or T_NS_SEPARATOR token. + * + * @param \ArrayIterator $tokens + * + * @return void + */ + private function skipToNextStringOrNamespaceSeparator(\ArrayIterator $tokens) + { + while ($tokens->valid() && ($tokens->current()[0] !== T_STRING) && ($tokens->current()[0] !== T_NS_SEPARATOR)) { + $tokens->next(); + } + } + + /** + * Deduce the namespace name and alias of an import when we are at the T_USE token or have not reached the end of + * a USE statement yet. + * + * @param \ArrayIterator $tokens + * + * @return string + */ + private function extractUseStatement(\ArrayIterator $tokens) + { + $result = ['']; + while ($tokens->valid() + && ($tokens->current()[0] !== self::T_LITERAL_USE_SEPARATOR) + && ($tokens->current()[0] !== self::T_LITERAL_END_OF_USE) + ) { + if ($tokens->current()[0] === T_AS) { + $result[] = ''; + } + if ($tokens->current()[0] === T_STRING || $tokens->current()[0] === T_NS_SEPARATOR) { + $result[count($result) - 1] .= $tokens->current()[1]; + } + $tokens->next(); + } + + if (count($result) == 1) { + $backslashPos = strrpos($result[0], '\\'); + + if (false !== $backslashPos) { + $result[] = substr($result[0], $backslashPos + 1); + } else { + $result[] = $result[0]; + } + } + + return array_reverse($result); + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Float_.php b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php new file mode 100644 index 00000000..e58d8966 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Float_.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a Float. + */ +final class Float_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'float'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Integer.php b/vendor/phpdocumentor/type-resolver/src/Types/Integer.php new file mode 100644 index 00000000..be4555ef --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Integer.php @@ -0,0 +1,28 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +final class Integer implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'int'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Mixed.php b/vendor/phpdocumentor/type-resolver/src/Types/Mixed.php new file mode 100644 index 00000000..79695f45 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Mixed.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing an unknown, or mixed, type. + */ +final class Mixed implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'mixed'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Null_.php b/vendor/phpdocumentor/type-resolver/src/Types/Null_.php new file mode 100644 index 00000000..203b4227 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Null_.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing a null value or type. + */ +final class Null_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'null'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Object_.php b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php new file mode 100644 index 00000000..b337c715 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Object_.php @@ -0,0 +1,70 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Fqsen; +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing an object. + * + * An object can be either typed or untyped. When an object is typed it means that it has an identifier, the FQSEN, + * pointing to an element in PHP. Object types that are untyped do not refer to a specific class but represent objects + * in general. + */ +final class Object_ implements Type +{ + /** @var Fqsen|null */ + private $fqsen; + + /** + * Initializes this object with an optional FQSEN, if not provided this object is considered 'untyped'. + * + * @param Fqsen $fqsen + */ + public function __construct(Fqsen $fqsen = null) + { + if (strpos((string)$fqsen, '::') !== false || strpos((string)$fqsen, '()') !== false) { + throw new \InvalidArgumentException( + 'Object types can only refer to a class, interface or trait but a method, function, constant or ' + . 'property was received: ' . (string)$fqsen + ); + } + + $this->fqsen = $fqsen; + } + + /** + * Returns the FQSEN associated with this object. + * + * @return Fqsen|null + */ + public function getFqsen() + { + return $this->fqsen; + } + + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + if ($this->fqsen) { + return (string)$this->fqsen; + } + + return 'object'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Resource.php b/vendor/phpdocumentor/type-resolver/src/Types/Resource.php new file mode 100644 index 00000000..2c2526b7 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Resource.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'resource' Type. + */ +final class Resource implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'resource'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php b/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php new file mode 100644 index 00000000..1e2a6602 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Scalar.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'scalar' pseudo-type, which is either a string, integer, float or boolean. + */ +final class Scalar implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'scalar'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Self_.php b/vendor/phpdocumentor/type-resolver/src/Types/Self_.php new file mode 100644 index 00000000..1ba3fc5a --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Self_.php @@ -0,0 +1,33 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'self' type. + * + * Self, as a Type, represents the class in which the associated element was defined. + */ +final class Self_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'self'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Static_.php b/vendor/phpdocumentor/type-resolver/src/Types/Static_.php new file mode 100644 index 00000000..9eb67299 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Static_.php @@ -0,0 +1,38 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the 'static' type. + * + * Self, as a Type, represents the class in which the associated element was called. This differs from self as self does + * not take inheritance into account but static means that the return type is always that of the class of the called + * element. + * + * See the documentation on late static binding in the PHP Documentation for more information on the difference between + * static and self. + */ +final class Static_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'static'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/String_.php b/vendor/phpdocumentor/type-resolver/src/Types/String_.php new file mode 100644 index 00000000..8db59685 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/String_.php @@ -0,0 +1,31 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the type 'string'. + */ +final class String_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'string'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/This.php b/vendor/phpdocumentor/type-resolver/src/Types/This.php new file mode 100644 index 00000000..c098a939 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/This.php @@ -0,0 +1,34 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the '$this' pseudo-type. + * + * $this, as a Type, represents the instance of the class associated with the element as it was called. $this is + * commonly used when documenting fluent interfaces since it represents that the same object is returned. + */ +final class This implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return '$this'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/src/Types/Void_.php b/vendor/phpdocumentor/type-resolver/src/Types/Void_.php new file mode 100644 index 00000000..3d1be272 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/src/Types/Void_.php @@ -0,0 +1,34 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use phpDocumentor\Reflection\Type; + +/** + * Value Object representing the pseudo-type 'void'. + * + * Void is generally only used when working with return types as it signifies that the method intentionally does not + * return any value. + */ +final class Void_ implements Type +{ + /** + * Returns a rendered output of the Type as it would be used in a DocBlock. + * + * @return string + */ + public function __toString() + { + return 'void'; + } +} diff --git a/vendor/phpdocumentor/type-resolver/tests/unit/TypeResolverTest.php b/vendor/phpdocumentor/type-resolver/tests/unit/TypeResolverTest.php new file mode 100644 index 00000000..f226f8ed --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/tests/unit/TypeResolverTest.php @@ -0,0 +1,395 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection; + +use Mockery as m; +use phpDocumentor\Reflection\Types\Array_; +use phpDocumentor\Reflection\Types\Compound; +use phpDocumentor\Reflection\Types\Context; +use phpDocumentor\Reflection\Types\Object_; + +/** + * @coversDefaultClass phpDocumentor\Reflection\TypeResolver + */ +class TypeResolverTest extends \PHPUnit_Framework_TestCase +{ + /** + * @param string $keyword + * @param string $expectedClass + * + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Array_ + * @uses phpDocumentor\Reflection\Types\Object_ + * + * @dataProvider provideKeywords + */ + public function testResolvingKeywords($keyword, $expectedClass) + { + $fixture = new TypeResolver(); + + $resolvedType = $fixture->resolve($keyword, new Context('')); + + $this->assertInstanceOf($expectedClass, $resolvedType); + } + + /** + * @param string $fqsen + * + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Object_ + * @uses phpDocumentor\Reflection\Fqsen + * @uses phpDocumentor\Reflection\FqsenResolver + * + * @dataProvider provideFqcn + */ + public function testResolvingFQSENs($fqsen) + { + $fixture = new TypeResolver(); + + /** @var Object_ $resolvedType */ + $resolvedType = $fixture->resolve($fqsen, new Context('')); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Object_', $resolvedType); + $this->assertInstanceOf('phpDocumentor\Reflection\Fqsen', $resolvedType->getFqsen()); + $this->assertSame($fqsen, (string)$resolvedType); + } + + /** + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Object_ + * @uses phpDocumentor\Reflection\Fqsen + * @uses phpDocumentor\Reflection\FqsenResolver + */ + public function testResolvingRelativeQSENsBasedOnNamespace() + { + $fixture = new TypeResolver(); + + /** @var Object_ $resolvedType */ + $resolvedType = $fixture->resolve('DocBlock', new Context('phpDocumentor\Reflection')); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Object_', $resolvedType); + $this->assertInstanceOf('phpDocumentor\Reflection\Fqsen', $resolvedType->getFqsen()); + $this->assertSame('\phpDocumentor\Reflection\DocBlock', (string)$resolvedType); + } + + /** + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Object_ + * @uses phpDocumentor\Reflection\Fqsen + * @uses phpDocumentor\Reflection\FqsenResolver + */ + public function testResolvingRelativeQSENsBasedOnNamespaceAlias() + { + $fixture = new TypeResolver(); + + /** @var Object_ $resolvedType */ + $resolvedType = $fixture->resolve( + 'm\MockInterface', + new Context('phpDocumentor\Reflection', ['m' => '\Mockery']) + ); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Object_', $resolvedType); + $this->assertInstanceOf('phpDocumentor\Reflection\Fqsen', $resolvedType->getFqsen()); + $this->assertSame('\Mockery\MockInterface', (string)$resolvedType); + } + + /** + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Array_ + * @uses phpDocumentor\Reflection\Types\String_ + */ + public function testResolvingTypedArrays() + { + $fixture = new TypeResolver(); + + /** @var Array_ $resolvedType */ + $resolvedType = $fixture->resolve('string[]', new Context('')); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Array_', $resolvedType); + $this->assertSame('string[]', (string)$resolvedType); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Compound', $resolvedType->getKeyType()); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\String_', $resolvedType->getValueType()); + } + + /** + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Array_ + * @uses phpDocumentor\Reflection\Types\String_ + */ + public function testResolvingNestedTypedArrays() + { + $fixture = new TypeResolver(); + + /** @var Array_ $resolvedType */ + $resolvedType = $fixture->resolve('string[][]', new Context('')); + + /** @var Array_ $childValueType */ + $childValueType = $resolvedType->getValueType(); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Array_', $resolvedType); + + $this->assertSame('string[][]', (string)$resolvedType); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Compound', $resolvedType->getKeyType()); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Array_', $childValueType); + + $this->assertSame('string[]', (string)$childValueType); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Compound', $childValueType->getKeyType()); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\String_', $childValueType->getValueType()); + } + + /** + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Compound + * @uses phpDocumentor\Reflection\Types\String_ + * @uses phpDocumentor\Reflection\Types\Object_ + * @uses phpDocumentor\Reflection\Fqsen + * @uses phpDocumentor\Reflection\FqsenResolver + */ + public function testResolvingCompoundTypes() + { + $fixture = new TypeResolver(); + + /** @var Compound $resolvedType */ + $resolvedType = $fixture->resolve('string|Reflection\DocBlock', new Context('phpDocumentor')); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Compound', $resolvedType); + $this->assertSame('string|\phpDocumentor\Reflection\DocBlock', (string)$resolvedType); + + /** @var String $secondType */ + $firstType = $resolvedType->get(0); + + /** @var Object_ $secondType */ + $secondType = $resolvedType->get(1); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\String_', $firstType); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Object_', $secondType); + $this->assertInstanceOf('phpDocumentor\Reflection\Fqsen', $secondType->getFqsen()); + } + + /** + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Compound + * @uses phpDocumentor\Reflection\Types\Array_ + * @uses phpDocumentor\Reflection\Types\Object_ + * @uses phpDocumentor\Reflection\Fqsen + * @uses phpDocumentor\Reflection\FqsenResolver + */ + public function testResolvingCompoundTypedArrayTypes() + { + $fixture = new TypeResolver(); + + /** @var Compound $resolvedType */ + $resolvedType = $fixture->resolve('\stdClass[]|Reflection\DocBlock[]', new Context('phpDocumentor')); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Compound', $resolvedType); + $this->assertSame('\stdClass[]|\phpDocumentor\Reflection\DocBlock[]', (string)$resolvedType); + + /** @var Array_ $secondType */ + $firstType = $resolvedType->get(0); + + /** @var Array_ $secondType */ + $secondType = $resolvedType->get(1); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Array_', $firstType); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Array_', $secondType); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Object_', $firstType->getValueType()); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Object_', $secondType->getValueType()); + } + + /** + * This test asserts that the parameter order is correct. + * + * When you pass two arrays separated by the compound operator (i.e. 'integer[]|string[]') then we always split the + * expression in its compound parts and then we parse the types with the array operators. If we were to switch the + * order around then 'integer[]|string[]' would read as an array of string or integer array; which is something + * other than what we intend. + * + * @covers ::__construct + * @covers ::resolve + * @covers :: + * + * @uses phpDocumentor\Reflection\Types\Context + * @uses phpDocumentor\Reflection\Types\Compound + * @uses phpDocumentor\Reflection\Types\Array_ + * @uses phpDocumentor\Reflection\Types\Integer + * @uses phpDocumentor\Reflection\Types\String_ + */ + public function testResolvingCompoundTypesWithTwoArrays() + { + $fixture = new TypeResolver(); + + /** @var Compound $resolvedType */ + $resolvedType = $fixture->resolve('integer[]|string[]', new Context('')); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Compound', $resolvedType); + $this->assertSame('int[]|string[]', (string)$resolvedType); + + /** @var Array_ $firstType */ + $firstType = $resolvedType->get(0); + + /** @var Array_ $secondType */ + $secondType = $resolvedType->get(1); + + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Array_', $firstType); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Integer', $firstType->getValueType()); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\Array_', $secondType); + $this->assertInstanceOf('phpDocumentor\Reflection\Types\String_', $secondType->getValueType()); + } + + /** + * @covers ::__construct + * @covers ::addKeyword + * @uses phpDocumentor\Reflection\TypeResolver::resolve + * @uses phpDocumentor\Reflection\TypeResolver:: + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testAddingAKeyword() + { + // Assign + $typeMock = m::mock(Type::class); + + // Act + $fixture = new TypeResolver(); + $fixture->addKeyword('mock', get_class($typeMock)); + + // Assert + $result = $fixture->resolve('mock', new Context('')); + $this->assertInstanceOf(get_class($typeMock), $result); + $this->assertNotSame($typeMock, $result); + } + + /** + * @covers ::__construct + * @covers ::addKeyword + * @uses phpDocumentor\Reflection\Types\Context + * @expectedException \InvalidArgumentException + */ + public function testAddingAKeywordFailsIfTypeClassDoesNotExist() + { + $fixture = new TypeResolver(); + $fixture->addKeyword('mock', 'IDoNotExist'); + } + + /** + * @covers ::__construct + * @covers ::addKeyword + * @uses phpDocumentor\Reflection\Types\Context + * @expectedException \InvalidArgumentException + */ + public function testAddingAKeywordFailsIfTypeClassDoesNotImplementTypeInterface() + { + $fixture = new TypeResolver(); + $fixture->addKeyword('mock', 'stdClass'); + } + + /** + * @covers ::__construct + * @covers ::resolve + * @uses phpDocumentor\Reflection\Types\Context + * + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfTypeIsEmpty() + { + $fixture = new TypeResolver(); + $fixture->resolve(' ', new Context('')); + } + + /** + * @covers ::__construct + * @covers ::resolve + * @uses phpDocumentor\Reflection\Types\Context + * + * @expectedException \InvalidArgumentException + */ + public function testExceptionIsThrownIfTypeIsNotAString() + { + $fixture = new TypeResolver(); + $fixture->resolve(['a'], new Context('')); + } + + /** + * Returns a list of keywords and expected classes that are created from them. + * + * @return string[][] + */ + public function provideKeywords() + { + return [ + ['string', 'phpDocumentor\Reflection\Types\String_'], + ['int', 'phpDocumentor\Reflection\Types\Integer'], + ['integer', 'phpDocumentor\Reflection\Types\Integer'], + ['float', 'phpDocumentor\Reflection\Types\Float_'], + ['double', 'phpDocumentor\Reflection\Types\Float_'], + ['bool', 'phpDocumentor\Reflection\Types\Boolean'], + ['boolean', 'phpDocumentor\Reflection\Types\Boolean'], + ['resource', 'phpDocumentor\Reflection\Types\Resource'], + ['null', 'phpDocumentor\Reflection\Types\Null_'], + ['callable', 'phpDocumentor\Reflection\Types\Callable_'], + ['callback', 'phpDocumentor\Reflection\Types\Callable_'], + ['array', 'phpDocumentor\Reflection\Types\Array_'], + ['scalar', 'phpDocumentor\Reflection\Types\Scalar'], + ['object', 'phpDocumentor\Reflection\Types\Object_'], + ['mixed', 'phpDocumentor\Reflection\Types\Mixed'], + ['void', 'phpDocumentor\Reflection\Types\Void_'], + ['$this', 'phpDocumentor\Reflection\Types\This'], + ['static', 'phpDocumentor\Reflection\Types\Static_'], + ['self', 'phpDocumentor\Reflection\Types\Self_'], + ]; + } + + /** + * Provides a list of FQSENs to test the resolution patterns with. + * + * @return string[][] + */ + public function provideFqcn() + { + return [ + 'namespace' => ['\phpDocumentor\Reflection'], + 'class' => ['\phpDocumentor\Reflection\DocBlock'], + ]; + } +} diff --git a/vendor/phpdocumentor/type-resolver/tests/unit/Types/ContextFactoryTest.php b/vendor/phpdocumentor/type-resolver/tests/unit/Types/ContextFactoryTest.php new file mode 100644 index 00000000..20d63c95 --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/tests/unit/Types/ContextFactoryTest.php @@ -0,0 +1,188 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types { + +// Added imports on purpose as mock for the unit tests, please do not remove. + use Mockery as m; + use phpDocumentor\Reflection\DocBlock, + phpDocumentor\Reflection\DocBlock\Tag; + use phpDocumentor; + use \ReflectionClass; // yes, the slash is part of the test + + /** + * @coversDefaultClass \phpDocumentor\Reflection\Types\ContextFactory + * @covers :: + */ + class ContextFactoryTest extends \PHPUnit_Framework_TestCase + { + /** + * @covers ::createFromReflector + * @covers ::createForNamespace + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testReadsNamespaceFromClassReflection() + { + $fixture = new ContextFactory(); + $context = $fixture->createFromReflector(new ReflectionClass($this)); + + $this->assertSame(__NAMESPACE__, $context->getNamespace()); + } + + /** + * @covers ::createFromReflector + * @covers ::createForNamespace + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testReadsAliasesFromClassReflection() + { + $fixture = new ContextFactory(); + $expected = [ + 'm' => 'Mockery', + 'DocBlock' => 'phpDocumentor\Reflection\DocBlock', + 'Tag' => 'phpDocumentor\Reflection\DocBlock\Tag', + 'phpDocumentor' => 'phpDocumentor', + 'ReflectionClass' => 'ReflectionClass' + ]; + $context = $fixture->createFromReflector(new ReflectionClass($this)); + + $this->assertSame($expected, $context->getNamespaceAliases()); + } + + /** + * @covers ::createForNamespace + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testReadsNamespaceFromProvidedNamespaceAndContent() + { + $fixture = new ContextFactory(); + $context = $fixture->createForNamespace(__NAMESPACE__, file_get_contents(__FILE__)); + + $this->assertSame(__NAMESPACE__, $context->getNamespace()); + } + + /** + * @covers ::createForNamespace + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testReadsAliasesFromProvidedNamespaceAndContent() + { + $fixture = new ContextFactory(); + $expected = [ + 'm' => 'Mockery', + 'DocBlock' => 'phpDocumentor\Reflection\DocBlock', + 'Tag' => 'phpDocumentor\Reflection\DocBlock\Tag', + 'phpDocumentor' => 'phpDocumentor', + 'ReflectionClass' => 'ReflectionClass' + ]; + $context = $fixture->createForNamespace(__NAMESPACE__, file_get_contents(__FILE__)); + + $this->assertSame($expected, $context->getNamespaceAliases()); + } + + /** + * @covers ::createForNamespace + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testTraitUseIsNotDetectedAsNamespaceUse() + { + $php = "createForNamespace('Foo', $php); + + $this->assertSame([], $context->getNamespaceAliases()); + } + + /** + * @covers ::createForNamespace + * @uses phpDocumentor\Reflection\Types\Context + */ + public function testAllOpeningBracesAreCheckedWhenSearchingForEndOfClass() + { + $php = 'createForNamespace('Foo', $php); + + $this->assertSame([], $context->getNamespaceAliases()); + } + + /** + * @covers ::createFromReflector + */ + public function testEmptyFileName() + { + $fixture = new ContextFactory(); + $context = $fixture->createFromReflector(new \ReflectionClass('stdClass')); + + $this->assertSame([], $context->getNamespaceAliases()); + } + + /** + * @covers ::createFromReflector + */ + public function testEvalDClass() + { + eval(<<createFromReflector(new \ReflectionClass('Foo\Bar')); + + $this->assertSame([], $context->getNamespaceAliases()); + } + } +} + +namespace phpDocumentor\Reflection\Types\Mock { + // the following import should not show in the tests above + use phpDocumentor\Reflection\DocBlock\Description; +} diff --git a/vendor/phpdocumentor/type-resolver/tests/unit/Types/ContextTest.php b/vendor/phpdocumentor/type-resolver/tests/unit/Types/ContextTest.php new file mode 100644 index 00000000..165f415d --- /dev/null +++ b/vendor/phpdocumentor/type-resolver/tests/unit/Types/ContextTest.php @@ -0,0 +1,61 @@ + + * @license http://www.opensource.org/licenses/mit-license.php MIT + * @link http://phpdoc.org + */ + +namespace phpDocumentor\Reflection\Types; + +use Mockery as m; + +/** + * @coversDefaultClass \phpDocumentor\Reflection\Types\Context + */ +class ContextTest extends \PHPUnit_Framework_TestCase +{ + /** + * @covers ::__construct + * @covers ::getNamespace + */ + public function testProvidesANormalizedNamespace() + { + $fixture = new Context('\My\Space'); + $this->assertSame('My\Space', $fixture->getNamespace()); + } + + /** + * @covers ::__construct + * @covers ::getNamespace + */ + public function testInterpretsNamespaceNamedGlobalAsRootNamespace() + { + $fixture = new Context('global'); + $this->assertSame('', $fixture->getNamespace()); + } + + /** + * @covers ::__construct + * @covers ::getNamespace + */ + public function testInterpretsNamespaceNamedDefaultAsRootNamespace() + { + $fixture = new Context('default'); + $this->assertSame('', $fixture->getNamespace()); + } + + /** + * @covers ::__construct + * @covers ::getNamespaceAliases + */ + public function testProvidesNormalizedNamespaceAliases() + { + $fixture = new Context('', ['Space' => '\My\Space']); + $this->assertSame(['Space' => 'My\Space'], $fixture->getNamespaceAliases()); + } +} diff --git a/vendor/phpspec/prophecy/.gitignore b/vendor/phpspec/prophecy/.gitignore index c50c8c4a..0c93fcf3 100644 --- a/vendor/phpspec/prophecy/.gitignore +++ b/vendor/phpspec/prophecy/.gitignore @@ -1,4 +1,4 @@ *.tgz *.phar -bin -vendor +/composer.lock +/vendor diff --git a/vendor/phpspec/prophecy/.travis.yml b/vendor/phpspec/prophecy/.travis.yml index 004e612a..e75c39ef 100644 --- a/vendor/phpspec/prophecy/.travis.yml +++ b/vendor/phpspec/prophecy/.travis.yml @@ -1,6 +1,6 @@ language: php -php: [5.3, 5.4, 5.5, 5.6, 7, hhvm] +php: [5.3, 5.4, 5.5, 5.6, 7.0, hhvm] sudo: false @@ -14,6 +14,16 @@ branches: - /^feature\/.*$/ - /^optimization\/.*$/ -before_script: travis_retry composer install --no-interaction +matrix: + fast_finish: true + include: + - php: '7.0' + env: PHPDOCUMENTOR_REFLECTION_DOCBLOCK="^2.0" + +before_script: + - if [ -n "$PHPDOCUMENTOR_REFLECTION_DOCBLOCK" ]; then + composer require "phpdocumentor/reflection-docblock:${PHPDOCUMENTOR_REFLECTION_DOCBLOCK}" --no-update; + fi; + - travis_retry composer update --no-interaction script: vendor/bin/phpspec run -fpretty -v diff --git a/vendor/phpspec/prophecy/CHANGES.md b/vendor/phpspec/prophecy/CHANGES.md index c9b0b999..444c1fa6 100644 --- a/vendor/phpspec/prophecy/CHANGES.md +++ b/vendor/phpspec/prophecy/CHANGES.md @@ -1,3 +1,10 @@ +1.6.1 / 2016-06-07 +================== + + * Ignored empty method names in invalid `@method` phpdoc + * Fixed the mocking of SplFileObject + * Added compatibility with phpdocumentor/reflection-docblock 3 + 1.6.0 / 2016-02-15 ================== diff --git a/vendor/phpspec/prophecy/composer.json b/vendor/phpspec/prophecy/composer.json index 15be6735..23131b20 100644 --- a/vendor/phpspec/prophecy/composer.json +++ b/vendor/phpspec/prophecy/composer.json @@ -16,16 +16,17 @@ "email": "marcello.duarte@gmail.com" } ], + "require": { "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2", + "sebastian/comparator": "^1.1", "doctrine/instantiator": "^1.0.2", - "sebastian/recursion-context": "~1.0" + "sebastian/recursion-context": "^1.0" }, "require-dev": { - "phpspec/phpspec": "~2.0" + "phpspec/phpspec": "^2.0" }, "autoload": { @@ -36,7 +37,7 @@ "extra": { "branch-alias": { - "dev-master": "1.5.x-dev" + "dev-master": "1.6.x-dev" } } } diff --git a/vendor/phpspec/prophecy/composer.lock b/vendor/phpspec/prophecy/composer.lock deleted file mode 100644 index 795005ad..00000000 --- a/vendor/phpspec/prophecy/composer.lock +++ /dev/null @@ -1,720 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "0cb11a8d8108277277f9931f6e4fa947", - "content-hash": "d2c6dc828e1217dfa154bc2dbb431edb", - "packages": [ - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "time": "2015-06-14 21:17:01" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "2.0.4", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d68dbdc53dc358a816f00b300704702b2eaff7b8", - "reference": "d68dbdc53dc358a816f00b300704702b2eaff7b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "suggest": { - "dflydev/markdown": "~1.0", - "erusev/parsedown": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-0": { - "phpDocumentor": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "mike.vanriel@naenius.com" - } - ], - "time": "2015-02-03 12:10:50" - }, - { - "name": "sebastian/comparator", - "version": "1.2.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/937efb279bd37a375bcadf584dec0726f84dbf22", - "reference": "937efb279bd37a375bcadf584dec0726f84dbf22", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "time": "2015-07-26 15:48:44" - }, - { - "name": "sebastian/diff", - "version": "1.3.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "time": "2015-02-22 15:13:53" - }, - { - "name": "sebastian/exporter", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "time": "2015-06-21 07:55:53" - }, - { - "name": "sebastian/recursion-context", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" - } - ], - "packages-dev": [ - { - "name": "phpspec/php-diff", - "version": "v1.0.2", - "source": { - "type": "git", - "url": "https://github.com/phpspec/php-diff.git", - "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/php-diff/zipball/30e103d19519fe678ae64a60d77884ef3d71b28a", - "reference": "30e103d19519fe678ae64a60d77884ef3d71b28a", - "shasum": "" - }, - "type": "library", - "autoload": { - "psr-0": { - "Diff": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Chris Boulton", - "homepage": "http://github.com/chrisboulton", - "role": "Original developer" - } - ], - "description": "A comprehensive library for generating differences between two hashable objects (strings or arrays).", - "time": "2013-11-01 13:02:21" - }, - { - "name": "phpspec/phpspec", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/phpspec.git", - "reference": "36635a903bdeb54899d7407bc95610501fd98559" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/phpspec/zipball/36635a903bdeb54899d7407bc95610501fd98559", - "reference": "36635a903bdeb54899d7407bc95610501fd98559", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.1", - "php": ">=5.3.3", - "phpspec/php-diff": "~1.0.0", - "phpspec/prophecy": "~1.4", - "sebastian/exporter": "~1.0", - "symfony/console": "~2.3", - "symfony/event-dispatcher": "~2.1", - "symfony/finder": "~2.1", - "symfony/process": "^2.6", - "symfony/yaml": "~2.1" - }, - "require-dev": { - "behat/behat": "^3.0.11", - "bossa/phpspec2-expect": "~1.0", - "phpunit/phpunit": "~4.4", - "symfony/filesystem": "~2.1" - }, - "suggest": { - "phpspec/nyan-formatters": "~1.0 – Adds Nyan formatters" - }, - "bin": [ - "bin/phpspec" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.2.x-dev" - } - }, - "autoload": { - "psr-0": { - "PhpSpec": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "homepage": "http://marcelloduarte.net/" - } - ], - "description": "Specification-oriented BDD framework for PHP 5.3+", - "homepage": "http://phpspec.net/", - "keywords": [ - "BDD", - "SpecBDD", - "TDD", - "spec", - "specification", - "testing", - "tests" - ], - "time": "2015-09-07 07:07:37" - }, - { - "name": "symfony/console", - "version": "v2.7.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "5efd632294c8320ea52492db22292ff853a43766" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/5efd632294c8320ea52492db22292ff853a43766", - "reference": "5efd632294c8320ea52492db22292ff853a43766", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/process": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Console Component", - "homepage": "https://symfony.com", - "time": "2015-10-20 14:38:46" - }, - { - "name": "symfony/event-dispatcher", - "version": "v2.7.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "87a5db5ea887763fa3a31a5471b512ff1596d9b8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/87a5db5ea887763fa3a31a5471b512ff1596d9b8", - "reference": "87a5db5ea887763fa3a31a5471b512ff1596d9b8", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/stopwatch": "~2.3" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\EventDispatcher\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony EventDispatcher Component", - "homepage": "https://symfony.com", - "time": "2015-10-11 09:39:48" - }, - { - "name": "symfony/finder", - "version": "v2.7.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "2ffb4e9598db3c48eb6d0ae73b04bbf09280c59d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/2ffb4e9598db3c48eb6d0ae73b04bbf09280c59d", - "reference": "2ffb4e9598db3c48eb6d0ae73b04bbf09280c59d", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2015-10-11 09:39:48" - }, - { - "name": "symfony/process", - "version": "v2.7.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/process.git", - "reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4a959dd4e19c2c5d7512689413921e0a74386ec7", - "reference": "4a959dd4e19c2c5d7512689413921e0a74386ec7", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Process\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Process Component", - "homepage": "https://symfony.com", - "time": "2015-10-23 14:47:27" - }, - { - "name": "symfony/yaml", - "version": "v2.7.6", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "eca9019c88fbe250164affd107bc8057771f3f4d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/eca9019c88fbe250164affd107bc8057771f3f4d", - "reference": "eca9019c88fbe250164affd107bc8057771f3f4d", - "shasum": "" - }, - "require": { - "php": ">=5.3.9" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "time": "2015-10-11 09:39:48" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php index 18ea23ad..edd8b80d 100644 --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php +++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/MagicCallPatchSpec.php @@ -46,6 +46,18 @@ function it_ignores_existing_methods($node) $this->apply($node); } + /** + * @param \Prophecy\Doubler\Generator\Node\ClassNode $node + */ + function it_ignores_empty_methods_from_phpdoc($node) + { + $node->getParentClass()->willReturn('spec\Prophecy\Doubler\ClassPatch\MagicalApiInvalidMethodDefinition'); + + $node->addMethod(new MethodNode(''))->shouldNotBeCalled(); + + $this->apply($node); + } + /** * @param \Prophecy\Doubler\Generator\Node\ClassNode $node */ @@ -79,6 +91,15 @@ public function definedMethod() } } +/** + * @method void invalidMethodDefinition + * @method void + * @method + */ +class MagicalApiInvalidMethodDefinition +{ +} + /** * @method void undefinedMethod() * @method void definedMethod() diff --git a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php index 37fe82f6..42e854ac 100644 --- a/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php +++ b/vendor/phpspec/prophecy/spec/Prophecy/Doubler/ClassPatch/SplFileInfoPatchSpec.php @@ -88,4 +88,20 @@ function it_should_not_supply_a_file_for_a_directory_iterator($node, $method) $this->apply($node); } + /** + * @param \Prophecy\Doubler\Generator\Node\ClassNode $node + * @param \Prophecy\Doubler\Generator\Node\MethodNode $method + */ + function it_should_supply_a_file_for_a_spl_file_object($node, $method) + { + $node->hasMethod('__construct')->willReturn(true); + $node->getMethod('__construct')->willReturn($method); + $node->getParentClass()->willReturn('SplFileObject'); + + $method->setCode(Argument::that(function($value) { + return strpos($value, '.php') !== false; + }))->shouldBeCalled(); + + $this->apply($node); + } } diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php index 08126d98..23891c09 100644 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php +++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/MagicCallPatch.php @@ -11,17 +11,27 @@ namespace Prophecy\Doubler\ClassPatch; -use phpDocumentor\Reflection\DocBlock; use Prophecy\Doubler\Generator\Node\ClassNode; use Prophecy\Doubler\Generator\Node\MethodNode; +use Prophecy\PhpDocumentor\ClassAndInterfaceTagRetriever; +use Prophecy\PhpDocumentor\MethodTagRetrieverInterface; /** * Discover Magical API using "@method" PHPDoc format. * * @author Thomas Tourlourat + * @author Kévin Dunglas + * @author Théo FIDRY */ class MagicCallPatch implements ClassPatchInterface { + private $tagRetriever; + + public function __construct(MethodTagRetrieverInterface $tagRetriever = null) + { + $this->tagRetriever = null === $tagRetriever ? new ClassAndInterfaceTagRetriever() : $tagRetriever; + } + /** * Support any class * @@ -44,21 +54,17 @@ public function apply(ClassNode $node) $parentClass = $node->getParentClass(); $reflectionClass = new \ReflectionClass($parentClass); - $phpdoc = new DocBlock($reflectionClass->getDocComment()); - - $tagList = $phpdoc->getTagsByName('method'); - - $interfaces = $reflectionClass->getInterfaces(); - foreach($interfaces as $interface) { - $phpdoc = new DocBlock($interface); - $tagList = array_merge($tagList, $phpdoc->getTagsByName('method')); - } + $tagList = $this->tagRetriever->getTagList($reflectionClass); foreach($tagList as $tag) { $methodName = $tag->getMethodName(); + if (empty($methodName)) { + continue; + } + if (!$reflectionClass->hasMethod($methodName)) { - $methodNode = new MethodNode($tag->getMethodName()); + $methodNode = new MethodNode($methodName); $methodNode->setStatic($tag->isStatic()); $node->addMethod($methodNode); diff --git a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php index 84011598..eba82980 100644 --- a/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php +++ b/vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php @@ -56,6 +56,13 @@ public function apply(ClassNode $node) if ($this->nodeIsDirectoryIterator($node)) { $constructor->setCode('return parent::__construct("' . __DIR__ . '");'); + + return; + } + + if ($this->nodeIsSplFileObject($node)) { + $constructor->setCode('return parent::__construct("' . __FILE__ .'");'); + return; } @@ -79,7 +86,20 @@ public function getPriority() private function nodeIsDirectoryIterator(ClassNode $node) { $parent = $node->getParentClass(); + return 'DirectoryIterator' === $parent || is_subclass_of($parent, 'DirectoryIterator'); } + + /** + * @param ClassNode $node + * @return boolean + */ + private function nodeIsSplFileObject(ClassNode $node) + { + $parent = $node->getParentClass(); + + return 'SplFileObject' === $parent + || is_subclass_of($parent, 'SplFileObject'); + } } diff --git a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php index 8437dc2e..56f47b11 100644 --- a/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php +++ b/vendor/phpspec/prophecy/src/Prophecy/Exception/Doubler/MethodNotExtendableException.php @@ -1,10 +1,4 @@ + * Marcello Duarte + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Prophecy\PhpDocumentor; + +use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag; +use phpDocumentor\Reflection\DocBlock\Tags\Method; + +/** + * @author Théo FIDRY + * + * @internal + */ +final class ClassAndInterfaceTagRetriever implements MethodTagRetrieverInterface +{ + private $classRetriever; + + public function __construct(MethodTagRetrieverInterface $classRetriever = null) + { + if (null !== $classRetriever) { + $this->classRetriever = $classRetriever; + + return; + } + + $this->classRetriever = class_exists('phpDocumentor\Reflection\DocBlockFactory') && class_exists('phpDocumentor\Reflection\Types\ContextFactory') + ? new ClassTagRetriever() + : new LegacyClassTagRetriever() + ; + } + + /** + * @param \ReflectionClass $reflectionClass + * + * @return LegacyMethodTag[]|Method[] + */ + public function getTagList(\ReflectionClass $reflectionClass) + { + return array_merge( + $this->classRetriever->getTagList($reflectionClass), + $this->getInterfacesTagList($reflectionClass) + ); + } + + /** + * @param \ReflectionClass $reflectionClass + * + * @return LegacyMethodTag[]|Method[] + */ + private function getInterfacesTagList(\ReflectionClass $reflectionClass) + { + $interfaces = $reflectionClass->getInterfaces(); + $tagList = array(); + + foreach($interfaces as $interface) { + $tagList = array_merge($tagList, $this->classRetriever->getTagList($interface)); + } + + return $tagList; + } +} diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php new file mode 100644 index 00000000..1d2da8f0 --- /dev/null +++ b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/ClassTagRetriever.php @@ -0,0 +1,52 @@ + + * Marcello Duarte + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Prophecy\PhpDocumentor; + +use phpDocumentor\Reflection\DocBlock\Tags\Method; +use phpDocumentor\Reflection\DocBlockFactory; +use phpDocumentor\Reflection\Types\ContextFactory; + +/** + * @author Théo FIDRY + * + * @internal + */ +final class ClassTagRetriever implements MethodTagRetrieverInterface +{ + private $docBlockFactory; + private $contextFactory; + + public function __construct() + { + $this->docBlockFactory = DocBlockFactory::createInstance(); + $this->contextFactory = new ContextFactory(); + } + + /** + * @param \ReflectionClass $reflectionClass + * + * @return Method[] + */ + public function getTagList(\ReflectionClass $reflectionClass) + { + try { + $phpdoc = $this->docBlockFactory->create( + $reflectionClass, + $this->contextFactory->createFromReflector($reflectionClass) + ); + + return $phpdoc->getTagsByName('method'); + } catch (\InvalidArgumentException $e) { + return array(); + } + } +} diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php new file mode 100644 index 00000000..c0dec3de --- /dev/null +++ b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/LegacyClassTagRetriever.php @@ -0,0 +1,35 @@ + + * Marcello Duarte + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Prophecy\PhpDocumentor; + +use phpDocumentor\Reflection\DocBlock; +use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag; + +/** + * @author Théo FIDRY + * + * @internal + */ +final class LegacyClassTagRetriever implements MethodTagRetrieverInterface +{ + /** + * @param \ReflectionClass $reflectionClass + * + * @return LegacyMethodTag[] + */ + public function getTagList(\ReflectionClass $reflectionClass) + { + $phpdoc = new DocBlock($reflectionClass->getDocComment()); + + return $phpdoc->getTagsByName('method'); + } +} diff --git a/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php new file mode 100644 index 00000000..d3989dad --- /dev/null +++ b/vendor/phpspec/prophecy/src/Prophecy/PhpDocumentor/MethodTagRetrieverInterface.php @@ -0,0 +1,30 @@ + + * Marcello Duarte + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Prophecy\PhpDocumentor; + +use phpDocumentor\Reflection\DocBlock\Tag\MethodTag as LegacyMethodTag; +use phpDocumentor\Reflection\DocBlock\Tags\Method; + +/** + * @author Théo FIDRY + * + * @internal + */ +interface MethodTagRetrieverInterface +{ + /** + * @param \ReflectionClass $reflectionClass + * + * @return LegacyMethodTag[]|Method[] + */ + public function getTagList(\ReflectionClass $reflectionClass); +} diff --git a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php index 426df322..27e80f5b 100644 --- a/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php +++ b/vendor/phpspec/prophecy/src/Prophecy/Prophecy/MethodProphecy.php @@ -86,6 +86,7 @@ public function __construct(ObjectProphecy $objectProphecy, $methodName, $argume case 'Traversable': case 'Generator': // Remove eval() when minimum version >=5.5 + /** @var callable $generator */ $generator = eval('return function () { yield; };'); return $generator(); diff --git a/vendor/phpunit/php-timer/.gitignore b/vendor/phpunit/php-timer/.gitignore index a7419836..cb465d9e 100644 --- a/vendor/phpunit/php-timer/.gitignore +++ b/vendor/phpunit/php-timer/.gitignore @@ -1,7 +1,3 @@ -build/api -build/code-browser -build/coverage -build/logs -build/pdepend -cache.properties -phpunit.xml +/vendor +/composer.lock + diff --git a/vendor/phpunit/php-timer/.travis.yml b/vendor/phpunit/php-timer/.travis.yml index 1563ea39..fd8e8500 100644 --- a/vendor/phpunit/php-timer/.travis.yml +++ b/vendor/phpunit/php-timer/.travis.yml @@ -6,10 +6,18 @@ php: - 5.4 - 5.5 - 5.6 + - 7.0 + - nightly - hhvm +before_install: + - composer self-update + +install: + - travis_retry composer install --no-interaction --prefer-source + script: - - phpunit --bootstrap src/Timer.php tests + - ./vendor/bin/phpunit --bootstrap src/Timer.php tests notifications: email: false diff --git a/vendor/phpunit/php-timer/README.md b/vendor/phpunit/php-timer/README.md index 61e2cca2..1c5b7567 100644 --- a/vendor/phpunit/php-timer/README.md +++ b/vendor/phpunit/php-timer/README.md @@ -44,4 +44,4 @@ print PHP_Timer::resourceUsage(); The code above yields the output below: - Time: 0 ms, Memory: 0.50Mb + Time: 0 ms, Memory: 0.50MB diff --git a/vendor/phpunit/php-timer/composer.json b/vendor/phpunit/php-timer/composer.json index 4adc8dbc..a327276f 100644 --- a/vendor/phpunit/php-timer/composer.json +++ b/vendor/phpunit/php-timer/composer.json @@ -21,9 +21,13 @@ "require": { "php": ">=5.3.3" }, + "require-dev": { + "phpunit/phpunit": "~4|~5" + }, "autoload": { "classmap": [ "src/" ] } } + diff --git a/vendor/phpunit/php-timer/src/Timer.php b/vendor/phpunit/php-timer/src/Timer.php index 19fec739..34df0bae 100644 --- a/vendor/phpunit/php-timer/src/Timer.php +++ b/vendor/phpunit/php-timer/src/Timer.php @@ -91,7 +91,7 @@ public static function timeSinceStartOfRequest() public static function resourceUsage() { return sprintf( - 'Time: %s, Memory: %4.2fMb', + 'Time: %s, Memory: %4.2fMB', self::timeSinceStartOfRequest(), memory_get_peak_usage(true) / 1048576 ); diff --git a/vendor/phpunit/php-timer/tests/TimerTest.php b/vendor/phpunit/php-timer/tests/TimerTest.php index 9d97d300..f18c24b0 100644 --- a/vendor/phpunit/php-timer/tests/TimerTest.php +++ b/vendor/phpunit/php-timer/tests/TimerTest.php @@ -54,7 +54,7 @@ public function testTimeSinceStartOfRequest() public function testResourceUsage() { $this->assertStringMatchesFormat( - 'Time: %s, Memory: %s', + 'Time: %s, Memory: %fMB', PHP_Timer::resourceUsage() ); } diff --git a/vendor/phpunit/phpunit/.gitattributes b/vendor/phpunit/phpunit/.gitattributes index 821227aa..300d63bd 100644 --- a/vendor/phpunit/phpunit/.gitattributes +++ b/vendor/phpunit/phpunit/.gitattributes @@ -1,3 +1,4 @@ +/build export-ignore *.php diff=php composer.json merge=ours src/Runner/Version.php merge=ours diff --git a/vendor/phpunit/phpunit/.gitignore b/vendor/phpunit/phpunit/.gitignore index 65a2321e..8caea62d 100644 --- a/vendor/phpunit/phpunit/.gitignore +++ b/vendor/phpunit/phpunit/.gitignore @@ -1,22 +1,16 @@ -build/api -build/code-browser -build/coverage -build/logs -build/pdepend -build/phar -build/phpdox -build/*.phar -build/*.phar.asc -tests/TextUI/*.diff -tests/TextUI/*.exp -tests/TextUI/*.log -tests/TextUI/*.out -tests/TextUI/*.php -/bin -/vendor +/.ant_targets +/.idea +/build/documentation +/build/logfiles +/build/phar +/build/phpdox +/build/*.phar +/build/*.phar.asc +/tests/TextUI/*.diff +/tests/TextUI/*.exp +/tests/TextUI/*.log +/tests/TextUI/*.out +/tests/TextUI/*.php +/cache.properties /composer.lock -/composer.phar -phpunit.xml -cache.properties -.idea -.ant_targets +/vendor diff --git a/vendor/phpunit/phpunit/.travis.yml b/vendor/phpunit/phpunit/.travis.yml index 3be518e1..42a96aa2 100644 --- a/vendor/phpunit/phpunit/.travis.yml +++ b/vendor/phpunit/phpunit/.travis.yml @@ -7,11 +7,13 @@ php: - 5.5 - 5.6 - 7.0 + - nightly - hhvm matrix: allow_failures: - php: 7.0 + - php: nightly - php: hhvm sudo: false @@ -25,7 +27,7 @@ install: script: - ./phpunit - ./phpunit --configuration ./build/travis-ci-fail.xml > /dev/null; if [ $? -eq 0 ]; then echo "SHOULD FAIL"; false; else echo "fail checked"; fi; - - xmllint --noout --schema phpunit.xsd phpunit.xml.dist + - xmllint --noout --schema phpunit.xsd phpunit.xml - xmllint --noout --schema phpunit.xsd tests/_files/configuration.xml - xmllint --noout --schema phpunit.xsd tests/_files/configuration_empty.xml - xmllint --noout --schema phpunit.xsd tests/_files/configuration_xinclude.xml -xinclude diff --git a/vendor/phpunit/phpunit/CONTRIBUTING.md b/vendor/phpunit/phpunit/CONTRIBUTING.md index aee139f3..3071e282 100644 --- a/vendor/phpunit/phpunit/CONTRIBUTING.md +++ b/vendor/phpunit/phpunit/CONTRIBUTING.md @@ -13,7 +13,7 @@ Please note that this project is released with a [Contributor Code of Conduct](C Please make sure that you have [set up your user name and email address](http://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup) for use with Git. Strings such as `silly nick name ` look really stupid in the commit history of a project. -Pull requests for bug fixes must be based on the current stable branch whereas pull requests for new features must be based on the current alpha branch (when `5.0` is the current stable branch, then `5.1` is the current beta branch and `5.2` is the current alpha branch). +Pull requests for bug fixes must be based on the current stable branch whereas pull requests for new features must be based on the `master` branch. We are trying to keep backwards compatibility breaks in PHPUnit to an absolute minimum. Please take this into account when proposing changes. diff --git a/vendor/phpunit/phpunit/ChangeLog-4.8.md b/vendor/phpunit/phpunit/ChangeLog-4.8.md index 9d431870..b717a2a7 100644 --- a/vendor/phpunit/phpunit/ChangeLog-4.8.md +++ b/vendor/phpunit/phpunit/ChangeLog-4.8.md @@ -2,6 +2,25 @@ All notable changes of the PHPUnit 4.8 release series are documented in this file using the [Keep a CHANGELOG](http://keepachangelog.com/) principles. +## [4.8.27] - 2016-07-21 + +### Fixed + +* Fixed [#1968](https://github.com/sebastianbergmann/phpunit/issues/1968): Invalid data sets are not handled correctly for `@testWith` annotation + +## [4.8.26] - 2016-05-17 + +### Fixed + +* Fixed [phpunit-mock-objects/#301](https://github.com/sebastianbergmann/phpunit-mock-objects/issues/301): `PHPUnit_Framework_MockObject_MockBuilder::getMock()` calls `PHPUnit_Framework_TestCase::getMock()` with more arguments than accepted + +## [4.8.25] - 2016-05-10 + +### Fixed + +* Fixed [#2112](https://github.com/sebastianbergmann/phpunit/issues/2112): Output is html entity encoded when ran through `phpdbg` +* Fixed [#2158](https://github.com/sebastianbergmann/phpunit/issues/2158): Failure to run tests in separate processes if a file included into main process contains constant definition + ## [4.8.24] - 2016-03-14 ### Fixed @@ -177,6 +196,9 @@ New PHAR release due to updated dependencies * Made the argument check of `assertContains()` and `assertNotContains()` more strict to prevent undefined behavior such as [#1808](https://github.com/sebastianbergmann/phpunit/issues/1808) * Changed the name of the default group from `__nogroup__` to `default` +[4.8.27]: https://github.com/sebastianbergmann/phpunit/compare/4.8.26...4.8.27 +[4.8.26]: https://github.com/sebastianbergmann/phpunit/compare/4.8.25...4.8.26 +[4.8.25]: https://github.com/sebastianbergmann/phpunit/compare/4.8.24...4.8.25 [4.8.24]: https://github.com/sebastianbergmann/phpunit/compare/4.8.23...4.8.24 [4.8.23]: https://github.com/sebastianbergmann/phpunit/compare/4.8.22...4.8.23 [4.8.22]: https://github.com/sebastianbergmann/phpunit/compare/4.8.21...4.8.22 diff --git a/vendor/phpunit/phpunit/build.xml b/vendor/phpunit/phpunit/build.xml index 894fc5d3..bde33322 100644 --- a/vendor/phpunit/phpunit/build.xml +++ b/vendor/phpunit/phpunit/build.xml @@ -1,95 +1,116 @@ - + + - + + + - - + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + - + + + - - + + + - - - - - + + + - - - - - + + + + - - - - + + + + + + + + + + + + + + + - - - - + + + + + + + + + - - - + + + + + - - - + + + - - - + + + - + - - + @@ -99,189 +120,253 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + - - + + - + - + - + - + - + - - + + - + + - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/phpunit/phpunit/build/bin/phpab b/vendor/phpunit/phpunit/build/bin/phpab deleted file mode 100755 index 80eaec49..00000000 --- a/vendor/phpunit/phpunit/build/bin/phpab +++ /dev/null @@ -1,891 +0,0 @@ -#!/usr/bin/env php - '/vendor/zetacomponents/base/src/base.php', - 'ezcbaseconfigurationinitializer' => '/vendor/zetacomponents/base/src/interfaces/configuration_initializer.php', - 'ezcbasedoubleclassrepositoryprefixexception' => '/vendor/zetacomponents/base/src/exceptions/double_class_repository_prefix.php', - 'ezcbaseexception' => '/vendor/zetacomponents/base/src/exceptions/exception.php', - 'ezcbaseexportable' => '/vendor/zetacomponents/base/src/interfaces/exportable.php', - 'ezcbaseextensionnotfoundexception' => '/vendor/zetacomponents/base/src/exceptions/extension_not_found.php', - 'ezcbasefeatures' => '/vendor/zetacomponents/base/src/features.php', - 'ezcbasefile' => '/vendor/zetacomponents/base/src/file.php', - 'ezcbasefileexception' => '/vendor/zetacomponents/base/src/exceptions/file_exception.php', - 'ezcbasefilefindcontext' => '/vendor/zetacomponents/base/src/structs/file_find_context.php', - 'ezcbasefileioexception' => '/vendor/zetacomponents/base/src/exceptions/file_io.php', - 'ezcbasefilenotfoundexception' => '/vendor/zetacomponents/base/src/exceptions/file_not_found.php', - 'ezcbasefilepermissionexception' => '/vendor/zetacomponents/base/src/exceptions/file_permission.php', - 'ezcbasefunctionalitynotsupportedexception' => '/vendor/zetacomponents/base/src/exceptions/functionality_not_supported.php', - 'ezcbaseinit' => '/vendor/zetacomponents/base/src/init.php', - 'ezcbaseinitcallbackconfiguredexception' => '/vendor/zetacomponents/base/src/exceptions/init_callback_configured.php', - 'ezcbaseinitinvalidcallbackclassexception' => '/vendor/zetacomponents/base/src/exceptions/invalid_callback_class.php', - 'ezcbaseinvalidparentclassexception' => '/vendor/zetacomponents/base/src/exceptions/invalid_parent_class.php', - 'ezcbasemetadata' => '/vendor/zetacomponents/base/src/metadata.php', - 'ezcbasemetadatapearreader' => '/vendor/zetacomponents/base/src/metadata/pear.php', - 'ezcbasemetadatatarballreader' => '/vendor/zetacomponents/base/src/metadata/tarball.php', - 'ezcbaseoptions' => '/vendor/zetacomponents/base/src/options.php', - 'ezcbasepersistable' => '/vendor/zetacomponents/base/src/interfaces/persistable.php', - 'ezcbasepropertynotfoundexception' => '/vendor/zetacomponents/base/src/exceptions/property_not_found.php', - 'ezcbasepropertypermissionexception' => '/vendor/zetacomponents/base/src/exceptions/property_permission.php', - 'ezcbaserepositorydirectory' => '/vendor/zetacomponents/base/src/structs/repository_directory.php', - 'ezcbasesettingnotfoundexception' => '/vendor/zetacomponents/base/src/exceptions/setting_not_found.php', - 'ezcbasesettingvalueexception' => '/vendor/zetacomponents/base/src/exceptions/setting_value.php', - 'ezcbasestruct' => '/vendor/zetacomponents/base/src/struct.php', - 'ezcbasevalueexception' => '/vendor/zetacomponents/base/src/exceptions/value.php', - 'ezcbasewhateverexception' => '/vendor/zetacomponents/base/src/exceptions/whatever.php', - 'ezcconsoleargument' => '/vendor/zetacomponents/console-tools/src/input/argument.php', - 'ezcconsoleargumentalreadyregisteredexception' => '/vendor/zetacomponents/console-tools/src/exceptions/argument_already_registered.php', - 'ezcconsoleargumentexception' => '/vendor/zetacomponents/console-tools/src/exceptions/argument.php', - 'ezcconsoleargumentmandatoryviolationexception' => '/vendor/zetacomponents/console-tools/src/exceptions/argument_mandatory_violation.php', - 'ezcconsolearguments' => '/vendor/zetacomponents/console-tools/src/input/arguments.php', - 'ezcconsoleargumenttypeviolationexception' => '/vendor/zetacomponents/console-tools/src/exceptions/argument_type_violation.php', - 'ezcconsoledialog' => '/vendor/zetacomponents/console-tools/src/interfaces/dialog.php', - 'ezcconsoledialogabortexception' => '/vendor/zetacomponents/console-tools/src/exceptions/dialog_abort.php', - 'ezcconsoledialogoptions' => '/vendor/zetacomponents/console-tools/src/options/dialog.php', - 'ezcconsoledialogvalidator' => '/vendor/zetacomponents/console-tools/src/interfaces/dialog_validator.php', - 'ezcconsoledialogviewer' => '/vendor/zetacomponents/console-tools/src/dialog_viewer.php', - 'ezcconsoleexception' => '/vendor/zetacomponents/console-tools/src/exceptions/exception.php', - 'ezcconsoleinput' => '/vendor/zetacomponents/console-tools/src/input.php', - 'ezcconsoleinputhelpgenerator' => '/vendor/zetacomponents/console-tools/src/interfaces/input_help_generator.php', - 'ezcconsoleinputstandardhelpgenerator' => '/vendor/zetacomponents/console-tools/src/input/help_generators/standard.php', - 'ezcconsoleinputvalidator' => '/vendor/zetacomponents/console-tools/src/interfaces/input_validator.php', - 'ezcconsoleinvalidoptionnameexception' => '/vendor/zetacomponents/console-tools/src/exceptions/invalid_option_name.php', - 'ezcconsoleinvalidoutputtargetexception' => '/vendor/zetacomponents/console-tools/src/exceptions/invalid_output_target.php', - 'ezcconsolemenudialog' => '/vendor/zetacomponents/console-tools/src/dialog/menu_dialog.php', - 'ezcconsolemenudialogdefaultvalidator' => '/vendor/zetacomponents/console-tools/src/dialog/validators/menu_dialog_default.php', - 'ezcconsolemenudialogoptions' => '/vendor/zetacomponents/console-tools/src/options/menu_dialog.php', - 'ezcconsolemenudialogvalidator' => '/vendor/zetacomponents/console-tools/src/interfaces/menu_dialog_validator.php', - 'ezcconsolenopositionstoredexception' => '/vendor/zetacomponents/console-tools/src/exceptions/no_position_stored.php', - 'ezcconsolenovaliddialogresultexception' => '/vendor/zetacomponents/console-tools/src/exceptions/no_valid_dialog_result.php', - 'ezcconsoleoption' => '/vendor/zetacomponents/console-tools/src/input/option.php', - 'ezcconsoleoptionalreadyregisteredexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_already_registered.php', - 'ezcconsoleoptionargumentsviolationexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_arguments_violation.php', - 'ezcconsoleoptiondependencyviolationexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_dependency_violation.php', - 'ezcconsoleoptionexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option.php', - 'ezcconsoleoptionexclusionviolationexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_exclusion_violation.php', - 'ezcconsoleoptionmandatoryviolationexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_mandatory_violation.php', - 'ezcconsoleoptionmissingvalueexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_missing_value.php', - 'ezcconsoleoptionnoaliasexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_no_alias.php', - 'ezcconsoleoptionnotexistsexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_not_exists.php', - 'ezcconsoleoptionrule' => '/vendor/zetacomponents/console-tools/src/structs/option_rule.php', - 'ezcconsoleoptionstringnotwellformedexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_string_not_wellformed.php', - 'ezcconsoleoptiontoomanyvaluesexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_too_many_values.php', - 'ezcconsoleoptiontypeviolationexception' => '/vendor/zetacomponents/console-tools/src/exceptions/option_type_violation.php', - 'ezcconsoleoutput' => '/vendor/zetacomponents/console-tools/src/output.php', - 'ezcconsoleoutputformat' => '/vendor/zetacomponents/console-tools/src/structs/output_format.php', - 'ezcconsoleoutputformats' => '/vendor/zetacomponents/console-tools/src/structs/output_formats.php', - 'ezcconsoleoutputoptions' => '/vendor/zetacomponents/console-tools/src/options/output.php', - 'ezcconsoleprogressbar' => '/vendor/zetacomponents/console-tools/src/progressbar.php', - 'ezcconsoleprogressbaroptions' => '/vendor/zetacomponents/console-tools/src/options/progressbar.php', - 'ezcconsoleprogressmonitor' => '/vendor/zetacomponents/console-tools/src/progressmonitor.php', - 'ezcconsoleprogressmonitoroptions' => '/vendor/zetacomponents/console-tools/src/options/progressmonitor.php', - 'ezcconsolequestiondialog' => '/vendor/zetacomponents/console-tools/src/dialog/question_dialog.php', - 'ezcconsolequestiondialogcollectionvalidator' => '/vendor/zetacomponents/console-tools/src/dialog/validators/question_dialog_collection.php', - 'ezcconsolequestiondialogmappingvalidator' => '/vendor/zetacomponents/console-tools/src/dialog/validators/question_dialog_mapping.php', - 'ezcconsolequestiondialogoptions' => '/vendor/zetacomponents/console-tools/src/options/question_dialog.php', - 'ezcconsolequestiondialogregexvalidator' => '/vendor/zetacomponents/console-tools/src/dialog/validators/question_dialog_regex.php', - 'ezcconsolequestiondialogtypevalidator' => '/vendor/zetacomponents/console-tools/src/dialog/validators/question_dialog_type.php', - 'ezcconsolequestiondialogvalidator' => '/vendor/zetacomponents/console-tools/src/interfaces/question_dialog_validator.php', - 'ezcconsolestandardinputvalidator' => '/vendor/zetacomponents/console-tools/src/input/validators/standard.php', - 'ezcconsolestatusbar' => '/vendor/zetacomponents/console-tools/src/statusbar.php', - 'ezcconsolestatusbaroptions' => '/vendor/zetacomponents/console-tools/src/options/statusbar.php', - 'ezcconsolestringtool' => '/vendor/zetacomponents/console-tools/src/tools/string.php', - 'ezcconsoletable' => '/vendor/zetacomponents/console-tools/src/table.php', - 'ezcconsoletablecell' => '/vendor/zetacomponents/console-tools/src/table/cell.php', - 'ezcconsoletableoptions' => '/vendor/zetacomponents/console-tools/src/options/table.php', - 'ezcconsoletablerow' => '/vendor/zetacomponents/console-tools/src/table/row.php', - 'ezcconsoletoomanyargumentsexception' => '/vendor/zetacomponents/console-tools/src/exceptions/argument_too_many.php', - 'theseer\\autoload\\application' => '/phpab/Application.php', - 'theseer\\autoload\\applicationexception' => '/phpab/Application.php', - 'theseer\\autoload\\autoloadbuilderexception' => '/phpab/AutoloadRenderer.php', - 'theseer\\autoload\\autoloadrenderer' => '/phpab/AutoloadRenderer.php', - 'theseer\\autoload\\cache' => '/phpab/Cache.php', - 'theseer\\autoload\\cacheentry' => '/phpab/CacheEntry.php', - 'theseer\\autoload\\cacheexception' => '/phpab/Cache.php', - 'theseer\\autoload\\cachingparser' => '/phpab/CachingParser.php', - 'theseer\\autoload\\classdependencysorter' => '/phpab/DependencySorter.php', - 'theseer\\autoload\\classdependencysorterexception' => '/phpab/DependencySorter.php', - 'theseer\\autoload\\cli' => '/phpab/CLI.php', - 'theseer\\autoload\\clienvironmentexception' => '/phpab/CLI.php', - 'theseer\\autoload\\collector' => '/phpab/Collector.php', - 'theseer\\autoload\\collectorexception' => '/phpab/Collector.php', - 'theseer\\autoload\\collectorresult' => '/phpab/CollectorResult.php', - 'theseer\\autoload\\collectorresultexception' => '/phpab/CollectorResult.php', - 'theseer\\autoload\\composeriterator' => '/phpab/ComposerIterator.php', - 'theseer\\autoload\\composeriteratorexception' => '/phpab/ComposerIterator.php', - 'theseer\\autoload\\config' => '/phpab/Config.php', - 'theseer\\autoload\\factory' => '/phpab/Factory.php', - 'theseer\\autoload\\logger' => '/phpab/Logger.php', - 'theseer\\autoload\\parser' => '/phpab/Parser.php', - 'theseer\\autoload\\parseresult' => '/phpab/ParseResult.php', - 'theseer\\autoload\\parserexception' => '/phpab/Parser.php', - 'theseer\\autoload\\parserinterface' => '/phpab/ParserInterface.php', - 'theseer\\autoload\\pathcomparator' => '/phpab/PathComparator.php', - 'theseer\\autoload\\pharbuilder' => '/phpab/PharBuilder.php', - 'theseer\\autoload\\sourcefile' => '/phpab/SourceFile.php', - 'theseer\\autoload\\staticrenderer' => '/phpab/StaticRenderer.php', - 'theseer\\autoload\\version' => '/phpab/Version.php', - 'theseer\\directoryscanner\\directoryscanner' => '/vendor/theseer/directoryscanner/src/directoryscanner.php', - 'theseer\\directoryscanner\\exception' => '/vendor/theseer/directoryscanner/src/directoryscanner.php', - 'theseer\\directoryscanner\\filesonlyfilteriterator' => '/vendor/theseer/directoryscanner/src/filesonlyfilter.php', - 'theseer\\directoryscanner\\includeexcludefilteriterator' => '/vendor/theseer/directoryscanner/src/includeexcludefilter.php', - 'theseer\\directoryscanner\\phpfilteriterator' => '/vendor/theseer/directoryscanner/src/phpfilter.php' - ); - } - - $class = strtolower($class); - - if (isset($classes[$class])) { - require 'phar://phpab.phar' . $classes[$class]; - } - } -); - -Phar::mapPhar('phpab.phar'); -define('PHPAB_VERSION', '1.21.0'); -$factory = new \TheSeer\Autoload\Factory(); -$factory->getCLI()->run(); -exit(0); - -__HALT_COMPILER(); ?> -) -phpab.phar8vendor/theseer/directoryscanner/src/directoryscanner.php"\BVA P7vendor/theseer/directoryscanner/src/filesonlyfilter.php -\BVAf<vendor/theseer/directoryscanner/src/includeexcludefilter.php^\BVTBl1vendor/theseer/directoryscanner/src/phpfilter.php \BVFA'vendor/zetacomponents/base/src/base.phpY\BV\0vendor/zetacomponents/base/src/base_autoload.phpN\BVH¬Lvendor/zetacomponents/base/src/exceptions/double_class_repository_prefix.phpV\BV6w7vendor/zetacomponents/base/src/exceptions/exception.php\BV CTsAvendor/zetacomponents/base/src/exceptions/extension_not_found.php6\BV~9 <vendor/zetacomponents/base/src/exceptions/file_exception.php-\BV5vendor/zetacomponents/base/src/exceptions/file_io.php\BVO;<vendor/zetacomponents/base/src/exceptions/file_not_found.phpJ\BV,T]DX=vendor/zetacomponents/base/src/exceptions/file_permission.php \BVDg7Ivendor/zetacomponents/base/src/exceptions/functionality_not_supported.php>\BV V&JFvendor/zetacomponents/base/src/exceptions/init_callback_configured.php\BV: Dvendor/zetacomponents/base/src/exceptions/invalid_callback_class.php_\BV -Z»Bvendor/zetacomponents/base/src/exceptions/invalid_parent_class.phpE\BV@vendor/zetacomponents/base/src/exceptions/property_not_found.php\BV"yAAvendor/zetacomponents/base/src/exceptions/property_permission.phpf\BVW>D?vendor/zetacomponents/base/src/exceptions/setting_not_found.phpT\BVH[Y;vendor/zetacomponents/base/src/exceptions/setting_value.php[\BV3vendor/zetacomponents/base/src/exceptions/value.php\BV.Ѷ6vendor/zetacomponents/base/src/exceptions/whatever.php \BV8K0vendor/zetacomponents/base/src/ezc_bootstrap.php|\BVMɶ+vendor/zetacomponents/base/src/features.php.\BV -''vendor/zetacomponents/base/src/file.php_H\BV ^'vendor/zetacomponents/base/src/init.phpV\BVukoGvendor/zetacomponents/base/src/interfaces/configuration_initializer.php\BVE8vendor/zetacomponents/base/src/interfaces/exportable.php\BVB59vendor/zetacomponents/base/src/interfaces/persistable.php\BV9J +vendor/zetacomponents/base/src/metadata.php\BVb0vendor/zetacomponents/base/src/metadata/pear.php\BV<3vendor/zetacomponents/base/src/metadata/tarball.php\BV g^*vendor/zetacomponents/base/src/options.php\BVy*Ll)vendor/zetacomponents/base/src/struct.php?\BVt<vendor/zetacomponents/base/src/structs/file_find_context.php \BV-њ?vendor/zetacomponents/base/src/structs/repository_directory.php \BVL8'U<vendor/zetacomponents/console-tools/src/console_autoload.phpr\BVi>vendor/zetacomponents/console-tools/src/dialog/menu_dialog.php\BV1wԶBvendor/zetacomponents/console-tools/src/dialog/question_dialog.php"\BV tQvendor/zetacomponents/console-tools/src/dialog/validators/menu_dialog_default.php\BV+Xvendor/zetacomponents/console-tools/src/dialog/validators/question_dialog_collection.php\BVONUvendor/zetacomponents/console-tools/src/dialog/validators/question_dialog_mapping.php\BVFSvendor/zetacomponents/console-tools/src/dialog/validators/question_dialog_regex.php\BV{Rvendor/zetacomponents/console-tools/src/dialog/validators/question_dialog_type.phpC\BV(9vendor/zetacomponents/console-tools/src/dialog_viewer.php" -\BV?R28?vendor/zetacomponents/console-tools/src/exceptions/argument.php\BVX ζRvendor/zetacomponents/console-tools/src/exceptions/argument_already_registered.phpE \BV/wm'Svendor/zetacomponents/console-tools/src/exceptions/argument_mandatory_violation.php\BV Hvendor/zetacomponents/console-tools/src/exceptions/argument_too_many.php\BV*Y۶Nvendor/zetacomponents/console-tools/src/exceptions/argument_type_violation.phps\BVu[:MCvendor/zetacomponents/console-tools/src/exceptions/dialog_abort.php\BV"@vendor/zetacomponents/console-tools/src/exceptions/exception.php\BVP[ Jvendor/zetacomponents/console-tools/src/exceptions/invalid_option_name.php\BVdLvendor/zetacomponents/console-tools/src/exceptions/invalid_output_target.php\BV]vmwIvendor/zetacomponents/console-tools/src/exceptions/no_position_stored.php\BVRGyMvendor/zetacomponents/console-tools/src/exceptions/no_valid_dialog_result.php\BVX=vendor/zetacomponents/console-tools/src/exceptions/option.php\BV}YPvendor/zetacomponents/console-tools/src/exceptions/option_already_registered.php\BV-/߶Qvendor/zetacomponents/console-tools/src/exceptions/option_arguments_violation.php\BV~xRvendor/zetacomponents/console-tools/src/exceptions/option_dependency_violation.php\BVrQvendor/zetacomponents/console-tools/src/exceptions/option_exclusion_violation.php\BVhVmQvendor/zetacomponents/console-tools/src/exceptions/option_mandatory_violation.phph\BVYXpAKvendor/zetacomponents/console-tools/src/exceptions/option_missing_value.php\BVF^Fvendor/zetacomponents/console-tools/src/exceptions/option_no_alias.php \BVHvendor/zetacomponents/console-tools/src/exceptions/option_not_exists.php$\BV6ESvendor/zetacomponents/console-tools/src/exceptions/option_string_not_wellformed.php \BV0Mvendor/zetacomponents/console-tools/src/exceptions/option_too_many_values.phpw\BVLvendor/zetacomponents/console-tools/src/exceptions/option_type_violation.php\BVD/1vendor/zetacomponents/console-tools/src/input.phpK\BV&}h:vendor/zetacomponents/console-tools/src/input/argument.php\BVh";vendor/zetacomponents/console-tools/src/input/arguments.phpb!\BVJESJvendor/zetacomponents/console-tools/src/input/help_generators/standard.php9\BVBj8vendor/zetacomponents/console-tools/src/input/option.phpO\BVS~Evendor/zetacomponents/console-tools/src/input/validators/standard.php\BV x=vendor/zetacomponents/console-tools/src/interfaces/dialog.phpT \BV*/Z;Gvendor/zetacomponents/console-tools/src/interfaces/dialog_validator.php\BV 5Kvendor/zetacomponents/console-tools/src/interfaces/input_help_generator.php\BVtӁFvendor/zetacomponents/console-tools/src/interfaces/input_validator.phpy\BVeutovLvendor/zetacomponents/console-tools/src/interfaces/menu_dialog_validator.php\BVTPvendor/zetacomponents/console-tools/src/interfaces/question_dialog_validator.php\BV&cֶ:vendor/zetacomponents/console-tools/src/options/dialog.php2 \BV3Y?vendor/zetacomponents/console-tools/src/options/menu_dialog.php\BV1vf:vendor/zetacomponents/console-tools/src/options/output.php\BV0ِI?vendor/zetacomponents/console-tools/src/options/progressbar.php\BVte%Cvendor/zetacomponents/console-tools/src/options/progressmonitor.phpF \BV Cvendor/zetacomponents/console-tools/src/options/question_dialog.php\BVWia=vendor/zetacomponents/console-tools/src/options/statusbar.php \BVp~[9vendor/zetacomponents/console-tools/src/options/table.phpL"\BVseK2vendor/zetacomponents/console-tools/src/output.phpM\BVW?7vendor/zetacomponents/console-tools/src/progressbar.php:\BVdm|;vendor/zetacomponents/console-tools/src/progressmonitor.phpZ\BVq5vendor/zetacomponents/console-tools/src/statusbar.php \BVj rM?vendor/zetacomponents/console-tools/src/structs/option_rule.php\BV Avendor/zetacomponents/console-tools/src/structs/output_format.phpk\BVh+-Bvendor/zetacomponents/console-tools/src/structs/output_formats.php+\BVD1vendor/zetacomponents/console-tools/src/table.php)s\BVsB16vendor/zetacomponents/console-tools/src/table/cell.php\BV+(Կ5vendor/zetacomponents/console-tools/src/table/row.phpw/\BV -h%ڶ8vendor/zetacomponents/console-tools/src/tools/string.php\BVF)phpab/Application.php \BVa -K䛶phpab/AutoloadRenderer.phpb#\BV -B" phpab/CLI.phpY\BV'޶phpab/Cache.php@\BV "9phpab/CacheEntry.php\BVжphpab/CachingParser.php\BVPI!phpab/Collector.phpe \BV*gLqphpab/CollectorResult.php -\BV8[ phpab/ComposerIterator.phpy\BVRphpab/Config.php/0\BVk öphpab/DependencySorter.phpm\BVo0&_phpab/Factory.php;\BV+Զphpab/Logger.php\BV!phpab/ParseResult.phpg\BVWߪphpab/Parser.php C\BV -lPphpab/ParserInterface.php\BVphpab/PathComparator.phpf\BVhaphpab/PharBuilder.phpw\BVDLBphpab/SourceFile.php\BV%phpab/StaticRenderer.php\BV,phpab/Version.php -\BV?"phpab/templates/ci/default.php.tpl\BV/]iphpab/templates/ci/phar.php.tpl\BV~ phpab/templates/ci/php52.php.tpl\BV ^@N"phpab/templates/cs/default.php.tpl\BVBw#phpab/templates/cs/phar.php.tpl\BV2q$ phpab/templates/cs/php52.php.tpl\BV&N˶phpab/templates/static.php.tpl\BVp휺"phpab/templates/staticphar.php.tplW\BVT.ֶYsbk CL^_j?[!QI4F6ۻ{:&)nwo{{_~[<,Nޝ;ċURhLÇ??DB/zI*?3JZp'{4 4#"CɄ7 Ld.Z'La4x$E2Â' M$~ -|^8 9f0#? >!<=Wzni$z)Rēz,M喊4V& $@S\8KZ᪓ <9; ZK (~;7]U{kҊ=\Rfzghh6I 0 ]g3TvL0*#"\xPY`r۬ͨvD%8i0D!det8]]#F@%됓:CIqGepmY]iyٷz9`X4a-\Z4Rj8㫡Hn̶W&-jݕLe$!]тLd8;nWE{`kCffѬEt5ehٺC4z+ t ܒZV'3bh]ue|g|ZxGoi[uOpӮE<Z"]ijpU"bf邑=C.lۘINDf)}}-?NNHdJ  &x!%f8e+9,>H~5 L$kr}_i*M M(PW_bMm/~-jΆ{e1iFܱv@mD,Æ9,34hMs-{ ՁT5+*CP¶TB0eȅ[/ q~C?˝^&|AK4NX~ !͋-ߪoڭfy ^ _a)l1; @ԑWπOØ2(A{cȬY[y>?Yaݍ޽-%U,%`U~Tvͣ藡M~-³')`Bה ugpoVn(@'G5Jq[ 5a-yrD1G߯Uq=5Ks|8z#9^_̕ŜoϺf,痽*kXR6hB,B3]Tv̓gN(1bTЮ ~kK)[4m'էԠd}8snע8cd=ƠpL/ ~Pu@Q<PŽCqS kW|<1ɪ2jwɡz r 7CSHתVci9UPc7.AZ -T(CK)QbSϟ"},,#l_+YQfڑOGKٶꧥ#CE1?|_RQ⯺H6b]:` ;/HUVjz+ނs>Aeme<8q* %G'yvkʞxyU`e9اL:ݓSkaB+ -WIJ/O fe6M|Wq -woĮ;ɭĐ睌`}kVhgtDLUIRz mHsFͽ1>k =xN#V&gvS\ґ鈵Eeڎfw2jr:kui=g[ |ٹ__oůUK#_ͫ_&X yxʡf4Rt~_U|ƫK yi.ٚ3I֌ dEI{stg UxɷVao6_q(V.ܤ+eiE蘀,y4@蘈,,wGɋKlKwGeٍ߾[ݽכ> 2I?Qʒ$[<&(*L=qjFpI SX0\m(&Ht [vG|͆uIJRZ4++-*+ryJu))˩,jHrhUmimVPYm4[e,S(I;YUɔvRTkQោͦkJ<ʹ]iz{J*VH]jbYhQT^TY"A%+iO?pBd#TG?@=^:4676״H+CzǨKE[QIM/)%Oї:J b/.[BԍL -y -=,ۢ)@iAHY[tCkr'gt)^yhe$`_!#̥`~iLsYX㐏qgvgf@fW>CEgssY}[?> ALq`5LhBgO{=_:!ma̝g|΃N|#@\b̏)ڞ`Hv8fk=քC.oxHϢh_d[x? AN=ϑvtEfx0Ѯ8ykXxDE,mKA"?1 peySy,?g n=uJNkKj}H:ʍD -oE:6O\eIɍ50"?LKxR M|V@_{{T%d1c/HP⮷zwB,['OCi~J$fHk&J_N !JlTiv^ڬH_wPTC҇ӫoL}V}p4BOP\ӯwNW/O -{:/v;uT?ujCI=fJ1ZQ 2ZЖDJaP$;Bɲ(pb9ZGf~w{RҴH/jj`>O2y c]S%kYZ,*_MJJʌZR^R*dIHUjfK2_6SYDX3$e˛Ff}al$pB=rmWl>q_bImA*v[7ȧIM^LSiuhg̞Ei;YC4: ZD?D}J۝,CvI#<) 0g SenlNYI\wXGZK]HD,3IJS&eH:FjiP C{:mUvV׃L$Ytm^wK9&EDsY(]Qȧq-`<lUȄ $\yxp~ęܟ[ fǗC\,'mi9PXOc5 xk0HmX79 Ѹ s]/qiŚ8[!@ 5|Fdgsϙ0- 45lbJ+B ϱN\b떃r^q|lJ|p*bgѳx$IlB%9OZ<(O],@tY#h*\-D1YRB+<4)KtG#mj$6 4>ߤѽJQr&[z!@['Ia>-3Nu/+.DM:5_̈be5>;I\J`ZyfP@ym& zLmUUz͡%z[a*\ˁ]lhӖiO &/7Ωtk6goK{{U; ]&z2_ٌ'wY%Vx2mONΞпuDm5(Ȳ.o±39yBNN*Hx,II,Z'ׯT$I*I+hC,r.< -q-%9?)'aU˜0$"*LB\:DsB'rl,i8Ee݆ XI~^h]'KEEbFG@HOpRC=m_yqe& B~EbEf+G$D@djAB[V݀&鬧I^\i=],n2Lǣ8QB HU -gi%T0Mmɨqr-ίדp~w7`prqs޿qzyqv~s~y^8og!eH4DʉO%l!4yl̤%w2m - mS]$˒qdL@(p~TA52\M^ًr"8 pdjZk8@5,}U/Q{PFi y!9RƬ!8L̗):t 1=bDUDۃ1Fl=1?aL0R]Ntƛ``M4iMk PDWIv9Veb(I"wCl5[6eY*B\ dOR (79W=Y 0;pqZ3Æ+d|c@d -}yq(Obdq6+gaQΧ舕Z<~th ,}nxC/VRljo//|;^E+vDFu&Pמ6ȍyB̕SF‰5=$dфj,+ a0pAfɎ lK4z|o>CqTlooܳm'/Zw2z~zDv-dڲۦacFrX]TCMB˶e"/Lh>=|?, l ~n3bT5El\?=\`='ǻi}G`&Pz @x};I{%8I=ARSӞ7 vmQy0p$JffT@@8`SWv{Tt;Xղn!%=`@tORlwN247E@8Q2)SfmX8D3q Th y@REl%e0=ú]-fs>{}ּ%oác1MT]`kaM{I?ڦ`{~b.֑)e-pw+n^Aec2ֳa[ K/jL*{?T[LAbĥ7hL|7öPƆO - 8>c#@W`XYƀ\}yv1!@hb@µ瀭/v% 0J%'B)̆ꈒ>0dlMѾX?)P*[UUi8鬾Z]5u5ѦqIF>k]͞,z͎S$kD / І0b;5yo>8d]t=U*DZ>% pwtFbrNiFVH T{5l:<,]2V=b;ebFBr!Uo*FN ;|)H0b3bp} -J=e>4ތK|-6xh3U~s]h6l"Cȧ&a.sj*~3YePd^Tk{.ÈoS dr=`z -o9C>AV Mx[:w9?ˎP] J\`بab}P -5t ->swD<>>;)v$Zxo]վL}c~'S`ڌ{>A.e7f1ƤݱzMh/ĺd%1 6E4)6zY:5q&Ӝ69njc[Ud;sR$yL"EȤYΆۘ}]D&oMU0>aRL`m!ec0Unwi?;07`5;[AcEMAqL@w&@ Zczꕌh`2{Vo@ ѺFUgS VVb6/H W - >J/rcR9AYg7>54?ҵp' pJ6u~ vե)ͮ2Y<wv L/s'+ /ZʌJcϨ*1ip!.CZwhk 6|\wDK]jXZ$UG8 T]1UgNR[RzK}~tEW ġ3\Z t@ٵ1pÚEyV!淪Aag[>r<#l)jbUb$~>f '+Q(x~o)o S]qӉ̚u] -Tﱷ&Wv/4 @BVχjlZ:y|eaԡD1 ~V`pT@%:ƈ'EDu+|V$;f>rZ^]OtwtJ" .u8 99/ -H@t;ıՖu }&ޖ^A6%ly{zoNuQmaVJv ?9 +TVhhkóÛWMpqS{cmZ&NYZxMRq[Ft[oJNͯi\.W|6/!rS?8Ƈ䔅m{[#([Ә{/=-_zس%< Ey[&Qa{%IM$]h@vkNnjPK%^Ias\);lF+פ]UEp m=BcNT0n"fj՞}[깛k*wɒd׈U].X &wi_a mQfAEoU\ 5=x6*&כ ` ʘZPFme==A,xHwh@_ndLA2?<Km#LSj\QJ9Xe :ȝD+" U,)ަiҹ`AӅ}qDUt썎;LDZ@.Ṟ|geo+6Bq;|eDf!&[ٛgtkS7yyx!+K68pC+Ԑ=\l#z&}7Yy9eqrQ_!aHE{s],@ iȒ2?~{\%˩,WQ[< 9YۀzenZ ~=.O4U6+nZ*7_R]~ebJ0JV|6 Z2ZKJKkF=%ЩnEg#^dU8J.0ATyfC؞֪*; -(( @"De>h5a hb1&M*ȃVY2+|-|U?o:zk_ܙ%ZNL7ub7^K(5 " ҌrI+,*-K8u*ӯ93xu| Ju{fQd}" ,O@/vFb: rnWmP| -YNwK/Fak #炙I#KU;jkȒJ9+{/ 0*ZGrH+qL |?|^N'7x΄к]$Vi[p˯4x.n5wt0^|*^=~ƦN `L靃́x`Y> 2:4\:ףxN~^"eQМn-+ieVTxw els.\,QpdYASСM_Te">I}=ͮ#c}#9L\RzPY v-QVfnn8DnrZ+l6,A ZDeRKRQܧ!%JCQm$>́!}q,FÈ i\Kv@5LЕXj g jP1}DH%76M b2*3t]%ˎTGVI%Zܺ\ϢlRdcL ȤwrFt|{sƪOLФTpx-u(c@AS6"Үڨ/!G? Ô6Vv-~à[gRXJ&Ƈ3Fƚʬ](E%<jLע!b],kt3Hݐ(1#vڅd^]^%?j>&%CW\HFLE!SC6bYI3 xM OLUdqb62WC?ȧ}P7nt[<H.%YJzak[{K<~}W]&ރZ\Aʚ;8C89jgp}Ӈk)w{v:*3W(]C(E``/ش19:Jbx% U ;3%fjar8(sOF= Pb"{p;*x_tm披zrU^ts| wsIkoFߍTo0_qBZ*F}luZSCWSe#X vf;K;' ؾw޽dzrYvHh/V:D_\84ռB8wqfq$^ D0oΰR#SLa:}M1V+E"+ R?W )QK:>‚D)N- -PV 1yiʵU҃5ZT%1tq pLK\צjnwbpPNCJAgt2KB -CtnjoA̜ "P=s4ޗ'IR@I\cnuΑZ?*eIDIUIA.BШ` v,Z, DQw80}ϾLogp7Nf7p1\g鄾F0sHQ*|*-J+َb 얶ODJ=W"GOaRJ+帵+僩x )Lr?2XX:$I>G$a={/d-%jbe]SѲhnZXUp -"[Qdb@s$߬Si>y6fݡـ?pAl`PEO QFd4%n֥|~n}R̊?llƜlԞJ2{xQ ߃^hD懒ҥ~rR/='}r{9=H:j"ߴVVY5=F~9twxl:٧TaO0_q(Ui}+jնV"eO\lMݤM#Rƽw޻;*0W2!_2'J/1# -wo4U>z\1N_Jm4T2aG#WԠ$:P*)E\[:(6eDi Bj)tD 4# 4J?@JXW $j̘NDYnA5EENJ4ȘM,i]5c?(q@ѩGl RY d6]"VV`{tn[8޷ITK>I6M3bH,$y49&Vh <*bYL\ ָF &e6th n^L(̢\Y4v w㛛|9Dz-6!C@JSb*SMK'S!$Of52CƵɄƣq=mݖ|&\*Iౝ0d405|2v{ow-;N*ρּ6ڸɤ$b4TݾWo:ϸ*$ɢL lO2xQW/Tt1V!N\բo@۴W$[gfɃj f%yIZKӭV+"nDo*qHt !/auvϋVVړ9?oaa=r[~Xsn -spqTao0_qB -iumAEj~LrNSVwgv"!{wtR, vHfVNH%U -n?SaqPYD.U2|pq&%8g1aN{1Ez*a@Oě[RPi J%DriT{" 4 -X+#ӥ])4v) 7c)Ѩ!c7uZʞ=FXhSZVȣsw}.ˋL -{tn[8IK?saVUp_4l$I4|O̍ZR| VLT -4?RAs_?ؒ}n@Dv-O:Y#{wy_0ً?.~pFpV'&7"! 9[/Cmo@^57Bs(na/JǍjoWTe]t|M h_ ]|xvk/ =]Eex̱v <7-m+7,e]/:X'TQo0~ϯ8iJ&eKYJMG7&;ݤ bBPU>)?:BȤ0 . -0%~ΙF{>e.dӚt3s0eȵiBˍș -@ -jvU_m ]F`BQ=H]xFsw8"rS֔9Y\PvD,PaTnUf*^d+P7T/RyOFeIVn:)՝cDV5 uéCl Bh|\&Dn*DН} x%+1`N -0cPӼm'HUD17BɭoXC2"km]V[`ئgz$}lcG (yDrq]\q ,0[Q-b:!-*/ƀd§FYĔ[G1SNK'`<#yذJ4jmk5izUa8_1*-8RGzktT~Lbk;8j8- {3ooka!J )doXi+VCk#dM) ( kWvcB2c6 -kPZib\(ryťi 6r38$ S`hSveY BBePtkT'n -Qy,OE{RTŘߘ$:} # ?262EbU] -&S=?IԖzJ;fM˜z]M% 8]y]^M%Z||o.?xvKGZd*<;@n<;<,琫\ۡDCmdy^t?.| ]svݹ{Ô ,]EV -T [m<[sfǨ`UkjD9}r0\f'OWm V =0NݦwgEL1RLH_ -ȗ(Ԇ[A!4Rc`mBf/PYYg.3:y6[G!:D#&xj.\UQCb/lf7{6ӧԵqW~sr -d[04xPZhiBO.(Nm;o+ЖZO ;W_-+t[QJ?i\{Ji]]Vzhɥb[gOD/lv wzчq{^Un@}WJ\DqǤmJ.T1ih14; J3s̙Yʽc"DZY!T EhX*ZG[D( -B2P8ED^JO42Zȴ(-uFAPb"|rqKX5TҮ(FPiKJ%XriTt9" 4s7F&+ Rh̩ޜ[ -Nܖ^7lZ9c?(~ yN:PBY>;S,OPC7jǻ&^@V@/@XF`em~UU #<& o4zK[̍J(H4b"'VXTTeC)%\C85@*0^IjAJ2$)yGlwۢ֍Z){d #"~>. zSPb2EbyIC{ msR@?bu]#<&;{, -CRe,1[V`W`l\3VS]Em0*L_]:(}yAȃA4p5]_.*X,rF0_d>;.~C0L!Ln%n -C"xOrK[\%Gy*X" _qQlD1#֙GmK`):>x!aHk_4$SCGBa4},)c՞fպyčtDjJPF&¤Q^)ν;ǡMV%?nfvgYh0`SAȴrB* -pk ZeNj%6mҺqO3 damH# - ADl"zd/&"ϥH@#ݚH 6"*ro@09{t5X;ЍBcײl%vb잸ۖnuZ9rc?-? -`Pzt)+;/3%aeBeݺ;A[>V@pڹjEMӄ )btMMGanj/ *R%i݈;@*CWŐѶ q^I$ l7N!N{p>Ntwjv|>N$.feg =Ma3{\d>WMR(ONK'[a&W2#{EP'4~P*4ZK"sG)e_޺)F~d*1MH J}*.oGQM]S.9f5r8hi s\%FX{-G?Oޡ 8|^ -9x| L9(l޾IRtLƈ8%qI{R1(,gD{fy0yd}x:'¾_JghwXn<0L#xi9waq삳oTn@|+VRcR5%Tb(Oq^){>ǡ&D !rQl^0`s!HPZKQb,[ 05zb2{X8e4L%q0O%Q3bRI?YZXt"QGj6TJ}5Q$Q|@iz{! -oiUƁ5r -:oVy+ǒ׭+M3F'8sqPLrIX^dJhэ!1+!o̺[1犳 z,౱iZ ~RgxDaYR~W"-TI"y~P>q]!iD- ?$0$܆%N'2Ű" -"9L;F §² Rtj4s* j$i%R};"jzSus/[];L0{!;;{Ekù;鎶3F_4#;apvTak0_qAc۱.Mf6ӕ~*|v:'u;N Fg0ƒ{ZUQ|r LU Bi +|aO(U6e~\ -&WF_BaJv7dT IajjvL|FSn9[2e -7eTSǁP\IZy@ƤBVKdFV>4چ|!,,<ǂ@a_Gql_YjzP9⅙M7Vz=2+ b[DysU6h;7uoDOu:m-= 46o6'V:ڵ8|ZːNv<~8%kULowud/ipCc6A/DK6=j}R##j6=Fst9 TaO0_qk}iVډ!>!qlC9I MR{~?Y9F`!s\+Ǥ* 9"T,frY;rQ:pzE a_1GUw̃L |3'Yuh`Z['Tߺ0x`x۠fXog* ]A6kn2ڑ3 -@b0>c.{2ϤRܫ7/H+ΓSi482Tao0ί8EDY6*2tU?UUmJ}giIݻ. LB\I˄2[ ~ ~ժFmw lX[$CJp3'G5tKƶL#Tӎt1zD JV*;ZKe,׈Jkf)Ob3a<" -[P0*bY&\iVtPy".QctsU M!jrR@tCYҺSM/@uߌ)|# 'SKoGS]He1LtXUI{uQk7=`^ -a0> ömg):Dzȹ%CM=^Ċ5q-Y& @,ZMeczi@Pۘ(J!NGpq:xyy:JV<5\,x/zZ@ܹ/qr9Q)ډ u? [9Ndް!WzBT¸"=*a>mo'jr{!#(ПY|Z rM[m!yJ xhsE3Ω42}AŦƬ5ӻ:Wl<dt5!Rp"Ej}dIf8?|x?.ܗ`#:)Փ_BGbGEy7տRFݚJsn?[78TSMT-qMW2 X$C Ԃ|KSj!sNNOQϠh;*ۇ_Z EΤ `S)orB)6ud$(O䷃}(B]V݈x i}?D2 r|Y?F8.BJo4?tbUWp{v{ A[>E|b4z4^_2{,_69X,- ! m 6g}p\ T]k@|ׯXL!qǤ4u"!O,#ҝzwDдc3;WA80,RJgbQJ*[>X9vNhO],f4H+;X"YMУRVA2 b9@z/aG=>őF=H 6w#*eҧHE% @0w`dweE6JؖOK^ \wŘ"??Q+z\=JbSy~[?%OB%SI$I\gʤgg#@͖ CA6IaU;#nt^v_㬜% -Vn1_gAT~O - ΂2nQTIҫȃ^VBO #7mryW;ZwdЧ'K@ +V+ i\Ex|0a袏4?`85PEaD5c۷{$7ɢwxO.iK2uQYi%׋rPi{prEoh^9v1m 'vLDt0&: -Oϱ{xKiJNF!]$7 @Gv#t[#-| y.(A*<4X3L{#*4v+kb*,]PuS9a݋1O) -cA~u8y+4Uu)|tP0~5 zs h:W_q۶#m8P?b>%m!{5ĚFy֐⪘r &8mQn ل0Ia])W-?>Km -;Y.W傾f,>s) IF6LJV? 얾OLndFTш;4Ph*i@dJ:o*ˡ?p O 'vCX Tq{~f>JalmCևv -w=~Bwf'h2fԾ8tPۀ ?pC-p5$_frDQ$"FTÅEǞ^p _ >פ_cVWHg Ξh^'sFg+H\pXPr pݡ[{4Bs.On{Q{vwW1WS W蒗{ L5? 5b4*d^L{A5e9=w >x_3?QC &o[t=c~E0x5Fz!]:1R59$:VcIZʯ/:"lAGsuFOKftf[|ZY(=BOtl2g4~ $<8:h6:O(ĔFzN 4xcTnF|Wl>؆*}m5BKp>ȫ;h)=@E+&ٛٝݟ.egg3:QklAdO -|Wȏ쯟478KR!%wF St jcSiZ;Y֧W, yn澍P IfÒhǜook:st&1:T*ύ\*2DD sQ]{S\gه4o/RvLOBkQ c1;? 4O ]8UtAn*NQaLkra叨ye]-U"t&;Tv'{[q_}O+Rt05*,:b!0em/P6z4_hӛn[fV~s[^m-ִ~oՂ%UxF* ?M-cB<[`*Ƣa_ T2j[S d҇!Ym{|HM#~tԕl bGqmzb9 -a -M&Jqx(~HYxVUU4?)tfRhVpDЕqAH#́j,$Hrm q,nR'Yy|أYP${IU%.dȨ5F{2Xt Bd"Jki#BkY;Om|0{@ ;KT*VŠ,wGs.GWj1Fm$_ e?7h8N̆ц%׎)҇o?WEtϱeyhNQO;D/FA 5[~~|/}i ̿r޺w+_ѯXmU‚0aA >.~U]oF|~B0bGn2BԐ Qip:k;hE);{$m@`<-x]oArv63J,\FVZQUNHЧFˏUhjD)RЍjk ~ ƺRN 6Mj!M 6&A[C'QMA"(RUE)gez39?׾[hO;>2\siQ68"Nt.צ@zt dwF95-YJvד-p_Z1Ē/Ư4Obv%dlি,U@ĪȘݩ{]xú8!ԗI"[W$essޛRyn=^I`%\K AEΡqMp8!0mqFIFi6,F!]_҇b1-iFg2tG#gnG2Rk"TsGU~৞-!(I9fzaJh*ϩߒ7}=')pQD$;Ƶy큐;R;$%\; :.Vtz=<Mӛ|ʦ( c7tByJlpp@tNFt<X yn:9_y^`o_@tpLpx|2#Zc_dc~N@V_EJ}G%bU"'ᕊ;g `r{{(Pr>ڗkr+FhW:>_B4_#j-ȩRr+UVm4Y>娀`{|xfp"%G`v_>M3<3va%<9DQ)./9q'Zmo8_1kkMl\&En Zm"2%H%I?nu( _DӨ{/ZP&LH!'L9/oLkΒ4 -)4T܇$ԝ/"p,X:LJh_ 10Yc1Jl "IDukۻ+4ʌC"b`0F(f 3- >i*iBXMEݑ*k'2nZuVHWݗ4i6O[ Hс/=%(. -6G[9P?-H8Up\,`$IX,L Iϩ{\B1dBkm>{<QY j{mEU3e -Y+'1^a>nUD,Mxt^#%SWCȷWa-n '_Dޘ E].8mh} Ĩ5g+W?w_v_mu,o {:s7Mi_A;~0=T%R!ӻh B@$Ƞ Tܿq1.sزp0NG {>g1P?XYFBD@Apx™!:001䩄-TϤCj[E~Ɵ Y֜4^f"y7lƟ@\5rQv_4 s A8]-)s&On -cLք *&,.st. 2W6~E4@Gt/L! ׸[fwrƛ2OuAPnv5c t)f$"J3U^EЋIW7ۼC1O{R"\ϛ~p#Z|{0dsTF:l5|S1n {h"Bb^Lu1@`mǗ} ?c-]C.{{S$vDQг -Y㰴-:jTpAAK靬|el՛A*Kps˕ޗC=G)e`Q8!U,e3mR33mQ1kz:>ɤV儢<LR8̘br`+ -L1>iSa"W& چKgx! }7*31ZW%<7P#ͧ <5Qgq0Pz¡3hX ]bMJf)/>+KUմMrxQ'֙Ry*R4;Q,Y6wΔnTʚ .3#6e/ yU8/Pnl/&q/l %oZ|oc^TŕG_wozmFy 6JSYL$}d(lvr7u/~?`Sd,MN3HaV&yM -"LHr9dl,d(a$:@`sIJG6P< #ܚ,J,l\gltLΣ%wdlZiIq_o#և h_iY欐S 9 -qēVkOH:9D -K4s\36WՐ4D6kBJQ<_V1_IP*'3WKJtwjޞxu_뻫1e7n{v~; `l%FQ:dp@mrKD(Yg/"KPY"[DE+cT6hj+93J6>jLLzD:r=mC~BnΤE@f - -$?-D>OCR^UlZ$(_#8d")1ȵłA 3CuOsJ2a+cذ - Лp )}#O_| s"b _ yQ,&!r&ry΀F V3`0KßQ>M=ƳwvO0zlǚ -(8 G.)L ~( G$44iWZx}! %v;D^dͪ,"^ͣ`VR*Td\ѐ3q/>L{fLf?23}3ǯĴ|%eøZdg軔lO|@G~VNioD7Z:lȖ雋ޯ{2qhsR1`6CK#V- L0Hct jH2K -f-qoǒ?RaT  -|O(Vro ,|1 8r)|%0~l#MJc4O!V'ьTَ4M 4Lct%8| ]yև%|!h \W'a}Y8Kx8|Cl ZM` 's5F\{ -uefW쬤cNVƅJ "U,p*~%߆Ws84,%FSx)t;%O=\3{͎pttWG >{s.*JC)}ʱ?}WɆOZڏ[~6Jɾ=q GjFqZNҵ5n汌"̹ 2҅\s6'}sqt5l FĘڀy&来 DFi7`%u[V*BZB jT&Y(`@*-jR^h5Ã-x;d1H!Zg;@"rE^Pq1YP_ՀZsձ!jStu7vX!'K(sLA;IMqtϽR2;gИ꭫K _Ϥ{*PX]k,Kó"BU'Ř4K 3k&]<"Ti?,f, M/7QgG|+;-6z6m=%5 S3ENs"]RQ WO 8q=昩io0?؊q'a)Ә*}+2$Xaz%'*˫GZq҈5+#nxzC˫H>\DH],bRճ~TAx:u:-JսWt=Bd3D x% -0sՁioОXv ϔqn18)V_859}YhW{,gv[nA?&Qn'T%[NCXp}(ӄ CNrh#IoEQ78Ֆ,O]y3:ۇ|*Z#F -Ipu4RprkTuALQ'NK=rjЩ章..x -@R&75l;6w^*4˝bjauog/h}躥b&K}g 0۱f[R[`5~>K`ߐruĢgP3 /@3F> -pA9,ZןHrVV#-B$ (v&ibER,&xdjH%cQ_W)H'`Z'-P(5CV0 '1 -KSWDf GiP }Գ &FĠv6~j'Ͽmk'`W`qm[ $iucm:ϙ9^+U=Am2~3˜91{suV|-A5{F=I-E>VdO]%3_nݥt5}g+b7+J!t.pvx>|T6|9Й__T϶1fY4V,@SRI0[穞Zb /^40s^5'\qhؗs}-Sa?*ePA+Kգ"3(2BBF T -mN%M? J=OƠ!FiּҼO;ڟvll OwRf)J"MVRBuI5C<+]/q'hT)1Z1Ȃ1~r\ewB^Ť\dT~ZkYK[I47U\ H|5 -}.*!s€W APA",DK=^3%aÝ &}zO#$Sv?uΣ|*dJ):L^6У]6'!\ХVρSvwPa dS<ņm"mivC^ՙB駛 -#[-W)[r1OW$ 2z4_dKzq; yf1=j{$K 6@e Vo[`vܠm2UkjT<֧JW.Nkixc;jk>Ȅċ@ {.싛KPrM~|U31ށ},<S>*g)M"qD)C)í-cp)'ŹV-w\ Oٱ63;s,ba0{)1tIHk$IUxnfxFkی3]78nM^2f:WV #N< +_Ƌ:Ϳ&cλ2G.j!'-ł' z|4`mkuO< Pz8T؈)}}sоy3.dEK:uϊ$qވjާ=69$MJ\QG˨Hk:1]mL;.v-OGXɯ*^\_}{tXnF}WL  E,(NF&va9 0VچewޙP.vS\Μr^%ggGpע*iB`3|,`QߋK3 K⟉U%3fN?%9i+ iZL+ -oX9_piM`¹3s{?] ]$L0R 2AG )j3Qt*Zs j%6sQy::cx,ƺVUuHF~GCOtwϝA* S^Zt[`2u! s0T)`.P0K`nm9HjgyCLcfo&WQߕИX^llEtr@/V3.if6I.bMLs5:N`<9wx҃O_n?ç~|5;<k|&_7?c(Xj -=Q5} :b&R O9jɵk0TZNfTTwb]LQˀ$aa$qb|{LbgRdf n 2^5V -VoQjOm"CwvН2ٰb - >y}1xcx#]jOFs[i-$&~}ufV]VH56'}l᱗c4܎~tޚ-jҨ &-פl"t} FR*(ڢ1#Zn)#` i83!JkZB:> e,Z0d!TUNZ7vc׼WZ`;֍Ǟ?ދ WD۞qyd hpgZ5WEz -`uxvFO:kP*.Ve| U dB-JֹPnO:w6[˃tKcV\B '_xٹack:: -Dl .YQ⎍]2jL[/.nHxb,GXXC#cfrVՏXFQlw/f 7 -nqj޾X||9e{ܚ-3a,6s szDU/gW?tp'I`4X8Yޖ5R[ak𡷔]r~q\sK7Sq枖_S5"56-OGߙƨpc''B>D}a E6GIKcrO;Lq3b lHeB/T %im?oJY\#+{}n"=Y?٠k䛚'-X ,#Ͼ[m>T.;$v^&̷i/k#1DJ1W}LsnsW3OG T]o8|X}Huc[1Nha{EZb+*IEq߻Ka$ g|񪫻Yv}=kX@YPm*5}UӍ5{]&7:hlWrO%? -:MrY_uZ7 -pzЌ#j("zonaϪ_j?XC5`g3mCQNWu;r﷕VUG-zYדs始? t1^\=`lӉAQX. kFQ=uw܃5~HN0v^-:Y ð(xa]w캸E'{Ӑ֗^;xwXkmp*ǎj.hBp~L'ӒDnmxF^/Ç|>,m~[n676߬mGAo@loE&XG4}<Ǯ;l'mM\Of·$O/CwPF_%72ٷ٫Tao0_qNA|(i&׹$flgY9qWTE}{wgmN Jh/V_!(?zJ{.P %VHzd+\xe4LjF6c{uDi-2lOPYϕ@|Eg;(JEMi Db)l:iVkR-ݷe)*qpM7J9R=6c%^)࢓qd6T7bx>>Hl=%bM[+e 7#ٱg 01Py߾I"^[&QbrA]g/t5:G)K=AJ0ԢgQ!Ģq]ιԴH24;,pnlp\yKYNfMo+Xok<UZALwm: +:-  9enຖ ֐l*2(i01c2]3#@P 9dT+89iW%ΆL:1GFg`?}QGZ+i,A_yA\cMyBD FWyE;F*=kofe+a/<,jmGnoۀ2svk29{? Ua8_1ZDZG -lEjOrOM!lqnD]33~ϗML ]RWL5AiMAdkov^v&۫#itsNƔE2v:嘖5 -.匰dGHj:k6cERc?'JcfzsM{bt:ў:Tk9ZU:DDžrlsp(΀h*r㏅c`۞ʈu/#"@.1V26P:]M\J+؝}Tad˗ y$]UnfޮSЛjڬZbY2߯o! բ(#? -}|Ù LѪP4j sأ!Ky?% 7)%7n{$ 6I^=d>LߊDzJA[GW&+xeB8P `+PM tY -\VF3ce$}4wcS(8N6,$bZ~DEUgmݣUq)1k:w]MҢ$<<混i-8+#ZY!TK? -baLZ `3"^BdW:WR+ W]V:Dg>c&繥/b2CLPY"T&x?*6"i=,(CɩE R+3\,2,Baf"R21>pz]lu F@Q tȀvy'bJ[ n>Z* -KX -8ﲻusDyZ \+u3 6= Wp_gAO/_SѕϝB\f|"1ZcQݠ"#ղަ"A}LЪ&܌)mx?=4}d2FSb4݌ ǟHQ*|L3n*(5>U50[9X",fN)f40|mykR> lKdh WLnH51|pL`OH!cv5չwg*͚! -Ny5Qޮ6c V4GnU'THO;&5"]:Uy̮b\ԮzP#:ߝYyFђ{\|e5=w'~U*FTؔA?3VӃp` -$"!}rtxy*ؚeJ(8|adA?lݒ8B,bVrzfA#cD~x5]f{_̎XIa{+CdD66T8Z8Y+9 īdB&\%3.,պӼR9qɇݗТ lB! 7xJ[$gI'cpUM,o7obRܹ(u7:V˗w{<ȔK#D? -BKp@(5^[$5;a؁Yv "Bl9M3y{T"Iy=mr&|MBZSND9||aC|'p$v9?%w/X+RctDDݼ6 _wZل|.e!#GrFn;٭:"i_ 4 nP:W*of8WRxcO|٥iDBsRωY*UN‰A}ϫHs&B:5Xth l~-,pwQG ;,Ma}|lWGkH0YDZ'Jz, f[3H̺]i;ڮnlֲiGCMׄQTݱ/a)4;3'\%Nv(*kLW'ٵ}K#lKfǵ?:?tXo4+s<[xpا͠+07Mfn;d>omکQCɎ^>~S%m]CE>Xv5;7b#'woo'WmOH_1EIP+> mZ@ -mo&NY:tݙygf׿*t℃gY"o =W)6gb3 &d}{<kq<3dY^f>SqAo<;>u. E^ċRIX(8Oy0\^'oO!@dDzCXE'wB H52f rX+5aK.X -d< d-eZf!b H5`2ۃ7d6Os4O\\ۋd>g0~!&ӓp CBP4&FГ@j1u 0,,Y!̯нQpƒJ+HcE%t+7%䊺Jqm UYz6kХk[W l%I6W^DY6z"/N)Τ!}Olc!zK51j 5 -#}fR㎰P PߟWy'i$XsVęEW-D|4vC4_=Ee\]a8z}b>dKS &WW㘟f\3~h4Hj -*əE!zHv+KJarGM5Գ)EIճyd,5NjqE]U3td }0eG=¾z: -} eR/wht7Ի5jO5n,v%?bnkN]6VvϦFa@9덺Զ3åR -MK**h[ȑ@x՜w8Bzg#`;Iz 7 -GXW%8[YRV:7^Cp`LlYOVF֏v@^Zc5Bn4E~ysQqK c؛Yk^lv42_UKt]jEtK|yFZhyEU D[sƗ3jE*1UӟM}m_DߥuoU'ھ'HzJ;}V9q}" reD |_ C5@\l{oeTn.|ʊ|6np_mڒX7}V)+ͬv)qiv^wXmo6_q R{eIIgu8m C@KE&UJ#˶le6mlw{g$nZpW")2! !pzY¯T($bZJx\&܇Tygt4+I WAINJTi,"X9r&]Fvpq ZIH0׈JC ښE $05!>9xE8IA%Dĸ-2ʍI|[u2Jk1CE H=)[T)d /xh4v{5`3 -ˀ$M&i.3w{Wpteʈ' 11/hhkA(CbqtDtac&F F?뷷s.Gp}]A$ _Gp+kr-(+|m 8%1D /0S?P/˝cYh5E81k%EiԗBwS*RFd1hJRP̸,p.iSNI@No>LHZWe҉V"No,JM;4ȔK>X`D@B71F8Ѣaw,xhYz -V,"1;yA4 ?R%]H6, ]e3bzrY r1KpzN!QsHM r.w\H[:_sr h)UQZcԔ4$ - i 1PY3 *ZUYEB*Xml@ -\FT80& -Wd%?3`!}/MRZmf)Qnr9 ZK0a72n1\&BJ -}ŭ&%6AɛbٶM>榽*MyԤjjK0iKnkDA]T:1p|N6$ˈI9 =a&\V|QMIV%nT˹s[~x{FY.B:7%L1<.:B&[7Yϗ2Y3c7cM&BՄ`,o{kiMknVB*L proJk*7K1̙6ӧ_n)dys!j~/B'_n6גswK/ilX] 9}0)s<0ʫVbޙÊs-J ϵ&5<)X-]: WuF9ggTj@+Cl\ؔJbS i)DUwWQJJJ[Jh573A80,2Ja1u܌8\f,j_7a '(]^рV@MWuAB EraC8?#t[ZmnaCP"%%HE'‰ arVzgdu[neMV,%] dl<%;RTfL 7pH4꿎G>;PAc>]"Vե*ٽk/f? ll߆a۶3 ϴ)AbxN&r.U֒[_iDM2&hQ~EkqUL9Cߦg$}?lG(8I -(YpLULmQr͙l -HQ) |o<-}lȌ䩢B5Trk-i<*PYNI۰%[w/hEӰ߮_A\R~?__!/τ6\󈟍&+._҈dŧJ܉y$ EJ{n lKƢ;쀧= -}B'Aa;|>`|`h-K;VaoHίE>4 * -^U*؃]SͬR ;;3o޼*zE.`* D+'*#䝰ȦT5Yq )crb2Ae1Ϥ }zaVpR+L' -[(imDA,Q9;}b9 AbT֏4tGZh i*9(@*:(=v4 rvFf(46[r)4mj+ꎌI/a@鬳 _{R@iŇ+Gp XYR{wsƯ]榁^؛sի(jf,<6YJ>>U[P%bMX p}Ecq遴J?@ ߣI MY - ZdG㧢BSJ˭2%yyQYv}R[DyBH3Ȣțz~? -”ԉ&I)n &m70QQqLTM?jz~<`*ݛ[нz$ahAa{$! 1b7`ulY"Ykαhީ.׼~B*w2pBϝ괣y;rxQxeDibzHymYh;IEQ>^ #\>wtPv20SEljxVI>x] N'/Gm< -ms[wꋫ>l[tQjIn1-V%NODM;g羼c\^${Y(`?4ίB~Ro8jeѭCz܅'_7Jw/DjBhP$)% @EtQKt'w -^.d H/[Le?"LB|=!6cʱTϏڠ6ڟy`$/VaoHίE}l4!*"LMOZŬb8~3^0`{o|y+8;k\CaB -Ys?O3B7BcE]˂`,¯PL4+Uʘ$tU'נ$h!Sj,13.#Dsqi>@ȹM?#X!WE@%ψ*`X f)2K5OIfڀ$Z7')'SnTYKiу0I:xN'6:c@Y]v EbY -&#]b :ZRˀY)Vc Eژ]TUgp_$k$A>LyQ`)1,7rd%rMYE@ƊˤGх7AMy(ylN!4 a矧_u8 '( .|<+Nn)KP!$ -(~-uGb%"'%uϵLIhLkB)徣T4M} `mΒ ]S-?edZh 1_ f_?؉ +f.ǧo #}끝;f* !ԭ.pDphHI00-Ɠh6^޾oIK^2~q%أo[ߎiۜMng!6rg.#5, ]gx4LdR^.@q9E9DRk|)|I*MjI>q .yI yIme=enQ93ͲZxGxv䱂Jby%'M>7R >828luԴ7cN@TOwɈoo:eZ#úU.>546Ke=8giɻEO;:Qoˇ\icV -|4K.3av]E(ΚqV:)ڧI7o0L68m8WImtm-Jǡz{~j;umhGo[yzj}8oYr6}W`b;㚝>6m՗FXJEŞB͉l#"+0 WLFszn IM`kc-B#WotqE=^Ѭ6}ChZO!pGA=5D bQP6 IJ`{ UH`-F@S"(Z [`|EG\HQr<~Y.4#Y7G2K|iI tY 9 -[5H8߻a6>Ϥ&$6 -P =jw5 ȚkW=.lo7ܠzb >i3\Q(idf] 4`7u,1\Y:"BQX!xfz]Bb;o*rLjb{[X *xkomfX&79֍JWKg4~Q;Q?$ރ ?烞{ajwaumJ{ vmbH=f qII)<.(#ۥgpw)&73Y &WթM;^.s}!R*xRk!w=zluG?Xn#7}Wp?ȣ' "X  Zulځ}x{KfdNnҳѻwg #rŚ #Z&Ld&rMj=c&4[#81|b^fbI D}L)JKERc_d$N#kؖ Y(Ɂ{n6kꙬ@].9Mt>Gr0'S람?&a^RNe 'x uF׌))S[1\=XRim#|6ͥLǝghDk;]Fv)$vV%RLLYNB㸥"FJH- 22C El$kse:3MA&&*a.cw 7h—^%,FeBK/STԁ(ϭ!{X@n2ξARqf!iP. ['#*i*p oII`rR=t)M +3r[ӓ&"KAi13ifpoZx5\h;~˘T,Fȳ!'I:\2fdv{DR֙1r.s/玷z1oĕwl8Kr԰SCꅏ]+*NϲʄK]evim\Yv=kΠsU#SJ?X1#\Ω~mѢ _ X)vP\ -hNVȼ<)o9p(AĆXibK=>v (Y-G., .XEdT?' -01B r!MH…)vpp:xOąsg,l.γk))=t[mJؐKxkFg7f\>|Uq~4I QȒ[WpʗS@+b9G)fMXIy]~Xk},Q(uWmjJ3``2?)vi;iSd 36|V7/epGopAzJQyuӫ ^}085;0tNה2.Rȍ0&old}f8Cކ#f0\%>tq ^A:a0 {-^;?/BWw8<#ug -./ *%Cmxtn855rkz2n#>*rD$^|i2ߨ4r:&bs,$+U<%6OiQ>*vɢܮxWe1Wå -4,` K%o!KB&c~ bȯ-]9,3U 2;/(vUcr̃+3TTIܙOl=]}_ -1HjDaycNj8h-0 -Ba1m`)dZ@9;q=jv~{|^WStΌjG/DUﶲU)Ik1V#7t\ qĽj Oή;_kbqѺf")eۈDѬWy ee<ꇆXc辝퍰d@!\'oOm]-nJɾ6kYUsHYZ^1zJ:|^OmuoP`i?t }.يBo7 zqNv(0}_AxTz }j6?Ap}?Yo8'](>Ml9MQ,-6/8" I=-;-iEpyާh{>XH%D&KfVDW**ʅ6R%גjɢk=2$#h1gFe#L*OYrȘJRUf,7"_fBEb􀱉~|;]ݰȋs-f{f=ģyd/$fbɳ9t0IDW2F[XurJEkg#Tol@D[(r-JL<9 пpHK>^}8$105<_ l#׏'w yܤ<щ=l*`gd%L@Y# p_$" @(Xpmo[LE' ` 9m@. -Aدx`CX6] LwpUؙ0oSRe@P4cرJ @_u@w Xߒo}6X55 1Mc=<%1J=vGŧ)sOʉ|sfHAyǖmgk ɔgv1MKswM8_K8+dH\/^eMw,3TVk  -<*SҖ.򌯅A)(^cԸP.+\ oVj>hw5V\GL%Ieȓ d<2N rN(a}:{cV֎O1}O9 J -Z;dE>7OVuZRm;"M4 R1cN8JZ (NZJDlG.j*cs؍(MV¿Mv31];dDӑʠX"}]~|,e{2k عUDWo?̐uY_OO BH:+ 5-+%d<,vI# =W^luĂi l%<?qd:W Zv9SفpA+'jzz?B>aw.`gӫa^%O/ `э5-XyϠ̍N/ -'NhRjT@_[*arcq a*S -7nj!>XT0S3 fGxPcB,P[eVyV\xahTɊ+`DY/5Aϝ`|M;mx -x8QR5vlѪ)Q"ŬmAf* Aش+x{ Ej..}/h\v ;¡GsȂn^A o~_~! Q`qmb~"p]T06r{%|Wm*Ѥ;o >/*QM:sX5{A`mU橭mzCզd'OS8oW@{>s(k$gۮtdⴳכpW@"9I^M ݟ$ղU[}&Ah]JTƣHhgR'+C?mR>it49tݐ`Dc~ =gc/1AI#ā;zz IvNG}J(%rn'v eZj ->"` u!K7&~.~G `2VU;)^:Pæ50C'mTbS -Ay誰O]yU-L';𩛪s[|`;j} ?<;VplSc}dP͂\*?/73]W/G5ukrӅ.¡ڄaB iRu).Z-35Ze~0܇zwt/ Y[o~2T8vudT8XJ" jZ^-p 3Cr6DY/ _dt~~ٍ TbLd1L\$SM$[c+#eȍ,y AJy'd"dF5W+Z'&Uή7}B3iZ.s[GZHL6dl..ۑ?ҬFfl[(U~ؐ!ȨEun*i SDl-Sз@W7ޘ -jםʝ+]0#B;2^7|eXR:OH mX$ n]l QKL! -S*ckcҋh9ا jN]N<ݰ OF'Ra X-.OY*D9ԣ#aj302HCE!k7%o (uB8ORJ"O$Ay,L xx&"cHNTAq,]E=yrj8[ܟ#Af8FCXeU4 XB'CKuLbNM2¡T q a-G*`އu6ljݩ7 jf6ebi:ZS-b ]\ngv4_,_anH]eQE_|=A;]sۘA1~ȵ͘eDe#DӴd[ʳkgǯEPҸ;I8I9Līz,y۵Dl-M6u _e;HX5Yȩesg8Fl2DVZm0|@&EhSMHE'Jrf -Đ(!dܴLcC(̊#D2DIG+YxW +.ExՍ"Us* Zԃ)@UX,gRp !ͰU֤%PT',}_'`D Gp}ڕlZ\'Qɰx5[I@{=srg\t[ivW͚qGC>Z)_©KeM"8=*v]lIZbnUiǢ@m+-~/ktjZQ{Ǖf@з^3K~,7->ggf~(B#[Q射[>)jARfvy({4rGJ\'"|[DyM;<}Kr<^C3"*If!.X6'6zӊrQbm/ɤ3r<NoA@*t,Q,)؀hy)XgtZ0eK%ej5VKǖ * Bp_(_ds)#e45G#*ק>Z1-3e15:Vۘ!Kfe$tX 7UB\wv;^KP %k~ÄW4d+.-"QkJA==&|)XPw }X_'`('޸/5>. U".y掎.O/W)y}%=pz-߽;Zh9 =f`q~ɖM9$\*}uC˭fdB IJsfBƎwG<~);@#$!%jyyù|a#@Ĩ1W|;6<ޔ -ҶF'פn&`ǃ1J"H镊?$p@>n.z"cB#hhKDR2uAA\c4~`qp# -X0>Z8&1h![y軗w/` X\ l[5H[7 G"ڤչYzT֤UӇG1)jf cd gՕUYlzMcW]-EVm^O0^"4.x^', %]/l0 nQL0GQta{.L{s++f<`N̪^g߽i }ku@8hIP@R؜ѷY6y}@͒ 8`4uP!8rKOq{ (YڝKr<("Oqؕg(eV] ̔^KtɎ)lբQd#RPC2sDQx *g؉𡽑Ī2jY[سW}q@f`duUp; -Z{fZ0"2{\BFQkNt$t[}{9"GXyklK{Zms?E_e5G \ FZ!fүΩ4J3gɴ=Gm״ -(lkRګyڑtm)]*j _مmSE綾ddW"հk0AQ% -ZPaWq:[V0)3{+XGR7`9b M;pGw~;W4e%:A].HdM?wo[l~&X4^q'mI~r4 @GDZm9ӴGeO*Jw7B~ՄF +xpxI6 -{+wcRi D8#kN|om6WlžpmtEXmo9_*T!-)R rv{Y{~3c{ߒ gfe{]TH+˥*av)iet*-R7:gSssܘAMoe$1f<^5Ѕ1ƺӋ?Eδ( V:wr^id<ɅX è~r94NXK3ҰίT8hL*"GP0 c =&2V"7K28X7ԢCs;1I)mYaDHdVY*HGW?y%zedBazQ?ƸEih8\Nt C÷98dޫTVr<0@H95V -E/9d\%}62UI .B6N5NxaOi}|?cON']^ɛl|9.J=3)S61TbFE\Sd2Ʌ <<,7">DKk౒@ePt+% רwL$^x Пy2ң?_pH*bF9ajXX$rBH-֘Rj~h(MSO{ !x b%Fs+maPX,Ȧ5g:M0]F|b{^@1 -X2q>r @TisN r,RD`b|Ak$ qFk//W4@V4-A-n§/PΉH \j0lt_'J0zOe~OAG KW>.R1H琍L+X Wf ІQ1XIAtiY90,>/$U Rs5 bSl[&8@PNN&%)\%=_jR?h*][psZ޸ *9,M#[IiA ݇rx@Ѳ^BH]BE.SviЭ A)[ אNc.Fghhz/PeL BIJT'UY%mۙ|E1Ory؆Zd.=X\6(21?"2sثK_H^D[~Ј"M _GPt,k?pK1ې@ R0ʓ'>^yoGGvF wL*ڼ{EID\PuuHeG]g4V5ZZ$q@" ) 톡5^m8JfEJM<;"%TGtسgWxS^ͦqyfm -ߣ;F0LQ0XVЏ@ǏYEQk@OV%g L 4g 뱗;-:.y9eD E5td'0j M`h܋DQ%^jPD[~eڝ{=E6 Ia@'ߟbW.ǂ6Md`D>)mwqU=QQgD|u3a0qĂ}pQ^iݙGbQw?ўCmWMݞ~ %4jB4{y?XmoHίCUE" -wؔ4i^t* UUUb/fz!\~3]H^P3<3WJB<$㰫-/I3Dc>**kִyo"i/m;H7n =,+hçӻmx kCw)V@ A %rgq># q{-] -(vd^90i3U/787|e*1J[TU id\]ew]u:T y[#2Q|bz 8T%ϗEmxDžR*6)m -]ϛ 0NԽ2W:f41FdKxa;!]hXP"BrN6r1@^~h?ݲ_jjϩ:F%_s{pe{ 'Yq  wAӏeKE{9o8ۏ|"WWFk6U$+WXms6_udWާU'4ZKM'<I)%H).NLb}ؗgeGp -7*0*T_/47|'51 ʗSH4C\F?#=K"p -Z2JFXDXʥ Ifh4l)T2[6ݭ<H -JL7,r)%2*۩e Fܕ3bl?\Yo\s͓+ -זXFEY \PEi lxIi]R [_ٳ.[9ÿ/Q?ߜo_S[\[3.;ll-[ x${M-JN =(g{װcEX^} I5bq,!`B?1|+!eZ|EOSe@l Y t\H**γܭ搤GleR+Qf:YC\&l{c yZ?ݼ8SBr^>W>|L_|{f1!ْj?kuD&{uA/B6mq" Ґ.͖mYEf ׻;;n5YWN'WM^kts{K]ӷvP0|X@a:XAηne Kڜ)<]8<հׁ& \}RT.&8҆_4p֗Z -Oڱ8E%'ub4Ҳ]wi=M ^ޒ& irVQhpϰ{2m;(W`T">Τx2A:,۳#/7r§ v8v^f~;vů&Ī 8.*{;Ȫ"Y-*o\ z]#50/Ξ˛YQwnєЁ/_Vn6}W }*Mq58dDD$R%(E3#Rv.nօg̜3dξznT)!3 .o%ٕΔrDi%[i!+sVeR;7"ßl|+\xe4 c- m,TvZ7_]Dڻ @*%_ܭWװAϕpHU~kG`(R!9zgU`Z-۪󭨔&q]kݙ&rPuh07Gό89GHK%tP]9~ A̚D. M[$iv""%&Ez}#^9ߍD2FhIA ,ZŘ.P}"E,pMFG1MWݯt.VpuW>t1Hlϵ"O%jʰ<]4P'iy*ji+HZ$sG<]mqJ.ݏ*ʘO)I"]IŸ lCIsdޫR]7܋ϭi쪥pHPvMUI5y摺uGQc u^x!×tLOT9Z5'OYI)E9L./.I`%^n'G4p^{3gIbU(ji㼩B1U r8z_2alVK&^*;3?K?18tìkkCao,Mk]f E"*u c^g+In}>e*h! ہ#"ߺY{0M3>!8맜FStE<$륿kt =Pk\p%nFB=>E/^Y`rl80 e-) QU{S0#D[}oXͧ,/Э;߳dKj\#p amsÐet_䂟|\+hGDZQ8Tn0}+VYMkYlh]Gcn*6YߵiR5!{ιE[AxvlDLH!KWJUcˮAiO[+^3cVtQ,*Z+U{3Q,ǝD'jPZihkw"R#f"6ְ'_3@/lEw^S)Vµf5I'K EYYPDm*RII73ڒփF)3գKApBh18 ;T:fKĚLrս cR@׀Yv< _1OxtNr6I􄹕5Cn&Xqךn~P>Ģ,mt4mH6gR|8]]}fpvQ;&qo(wqr$˨>ډ 9,OqNE.DPGVm4x&es*) -'/;0`9Eq;dQ;K\|~U_o6ק8nhkmr[Y&5;R-ِm& -!0.(lN --+LTPRK *'ֆKYŴTPhH*YFTe -a*3xk@ -RNAeV*DERD~X&P :GZn6tkhBAXs[Ud*3Y/7d+P RIu/Oڋ1R~5 o/.z F);ә]]q&2k>\[/9* 5`&81q۶C*@1~GKb> -&l85jB5aXktF "E9:4Aߦh"Q_ ٘"Ia^I:Kima2fK[gbNߦ?g IFV!VQ{0n>3^色a%B)PaQjS{qMm7$֦crSQ(؝)xgՄ2VNu 91S˕Cg78r>y?.Qi?Mőf=5mr!{>=n< NcTձd ?g,W`=@`뷈õ33c400EP)?+k RwY39$?< HV'!!d{z"b''a[G ER(98SY>|.B(g͚Fdη/_U7]DiR \>⺈>Xި[Ѣod/<=e0Ë7ti;7 gsq8EQ\P 9D/ߝT]O0}ϯ&L{ ȀjX+ mؙ{ݤtDBsνOEPh/V:@ohg -Ll^g3](SxXfM`I*!鑚oEII:ZBiZUb", R@?LGg0'ϔ[H@(0'*e(M/ sa3.M*_x0Fl%vbܚ;.MZr݆ч"boa60~t) ;`H䒰*2[w3H]Kbf\F -60 x`lwKJv^s tZ+Kϖ *R%Ō -B ug`L/uMFi>$(hqr=*OG)Ll2>MG1i4>Rdt>UMRʼnbONBJ="G#0'R9.#G|h*ПS Sc)q,sqwS5]eußPC#}Xohg3gd~݊URhFJQՎZʝA78z}Er=5fO"1>Y_f˲}AŊC EnMk~hN0)k4jբG]U=NyeEJTKK{Z1 M?{Lx(vV?8ퟚ{G9NUQO0~ϯ8U<$at@hHirkؙ:ߝӔڄbw܏a*KL+'B٩VVP) -Nj22Ce1=vR^^VnT.I2}@MGȴqPvAџ$>lOaIK@+݊bV[XR*璏%HE '@09zmdr[ƮdM-dړ]XuM);UowJ%4FG]5(+LtXUṚ7m 7$:^p}VՇQԶm()Lf7ƀ$"dE1Sρݲ铭1KQyhDP;4~:j4ZK$sG%7exLxTOsUz)Q$(g2!~+CV$5wjgs xhѰ)IEuۤT?m]^$7dBAJ-Ʋ~Tݹ`>v{<`Q(:Tnl {@vJ$iB7`DEBU1=–RH`O'&wߒtQpeYnRr ,y?~ХKĚ ;bc>v䃻=Wg9g! saDg^ڦ ?@Oȓx SUnF}W  E,IXGBTa2 d.E3+RAj9s\fmBRIU _VVWQl+V~N9 }9*8DAXV>\G' -[9b1r:Aq)@',Ú!яtmFZšBZT ];,){Ɓ ˘Jc!-q붧rc_(Sq\;޻{PAkLp XTR{N9CD <K3nƹf]M<զ 'R6IoYUh-g+ iڃhU.VW7 ) {ۡ .tmH/ H6k4Rq:qs_(y -{[&,^&kQ IF1LJV~0pu r-sVޡҠZYP{ 7r~2+awJ -Ua -fՄ2 H~ġl" -dUɒqy͊V<7ei ھFNsECUp ;Ѥ P]ի?0wS'0~%\~<4v{Z>׫ZRJ ՠkEgӮ/`ݪ|Js`N7>Q>W\D?øU[EqRA޼c>0|ra/Īil=>lRYQd%j ##fEc^1(OfCfxh (w긶ޚa<!8wߝT]k@|ׯXLbXIH,!O,k;d-=KPJ igwfgn]Q#X! *g6gR6ڸKZM;"Ga Y,@рVhmXMvI}᥀ޞpS;0lv"<6EK 勉d~N{̽*Z֏F&VR7h u\cF~NmzoZOPۄh%'%q28O!ZeXaZ4^-##ZF6,J('si|5fr+3FޣQek-i<*PYׄ_R9UR֥GI CA_ -Co{!ao*cAπE[[)^{:9ϕ(eNmAV - sykiSX+阐BVjJZrQ;$Y;' b N@\\ JudwKG4$z2*sjĶst+ b9@g"],aGT=#p5ze`GXY -ߚ5 $)JvzBSKW#{,<% RTf _]vr.[vtODLA"j',H;yqsexߑY|EG̽lZrk' y=Ċ-qmX'@,zCjv NIM|7I3xHO&Ɋtzuv:$٣G~N YFpALw˳<|Z9Y\'yXPg4a%4VX?ZK$KG+\ߴ[rMv?R2J5q<$%B|܂BH%hH9F>3$VGlKf?ޡ,ûfO/{t!Tmk0_qAc۱6KfVݕ~*}ڒ'qb.QƲruQ{tVDH0 .r0NRhYb(v6\5p{-yBc -F:f =")lD,h5zEREKTGoC "\!V("DW~2m)Gh)hJbiѬ.hrD,PaTj'+d+Pt^lD>%{tR;3f -Yɟ0 4꾎&]=iZ9LtXUġ;u/g9) 6`O -0> m}RA/1&gH[Q֯+xVmkZ 5h9.E 1S$ dsΣ0]p7pU5`jHQT++r(~9nr5&< yr\PQU\h5L=*n\Si K~,ruJ0E~ -ޟٿJ^?qՁg$"s#ҍ5r.5UF6LnVc0:MeMc<8KUמKJF禢 tXPH/vhOLIv/ge꿀F Ivk{͖C w'n㑷| 1,a'}8E`r]|Tak0_qAc۱KfVݕ~*}vڒ&qӒb,+޻{Ojp4 -`s^!dRX%5>gS)0V|Xؔ)Ce `^ -8 uhX[°m 'Ra/1.{"cnEP~6\SW[`XelE\+ֺ AyVSE9vhӛxLM)j3D DI.N.oSnnEXtx9D{/ƀ2*OJ;Ĕb~䧞sK7'0H(V"rB]sFkdN2~K.ݏ.UYG\n:!#(П[˄2 Oך ˔|mxo/ΎT -A*Yh&okhE~~/x >T# RLr3;'׬gBQQP?.5F HwgfE@%m2{z:{D"owu; w `x3`\|~TQo0~W&`c;eiU*tU*x%6Mi6@4iHY[^Xx or) る -L?Z6+R$F*,O9[_tذe9=Y)D,d3:)Тu:*!#J!P$.}MJbm蹩)kzRpY\@SvxU@kRJI6#}H<%{ R&3YpL4c{@5;s]p&rԽ wCsR@0`f@mL{}QbpI17AɭCeĵakb+r\TKLjHO6z4 |(Ym~ޤp^_q^j_Di鴁0ȯQ|$˨>ʊ :dFvZ>s^䉪cB%QhQDqJ[dM5U*eäP=RWhńh㠮-;7CY(Gw^ ]Rd0+a4Lx3c^xH[]`U[?ke DIB4\A_(ĢΧ&ʹ"Imh!GuG6bD7n$nm #G) YFGҲbQLsnT(U$y-r(TťdJqP7UпSrIv?qnc -y?p}( -.?f<|/sQnH0::0[P7EhhlALfaziVѰTw?dHo-.ўcχ10%hI-й{;>K_?Tn@#5UiՄ&vaɐF9.V]Q Tfo7otVmpQ#p%-RlFոmPr^3cVsQ,*Z+U{3Q,ǝD5(44J;KPX֬RD_>fD a腭0+{*ŊB֬!DPctr(+ M%Z9)f"cS[zP(ez4c ?aN-=aBgXLtXւIѣ~,r77`^ -0PY۞a+ .IbxC&0Fcȭq~+rZMXҡMIQ -q/QKo .JxvW:mBO{'K@ZSb*X4qpidZb/8ɓeJR=Ѣnq5Dx4PK۴%d+5TTcRQKaϧ-B*ӶE97zX}>ODZXi){ڿ"\5974͜duz3O(,ٱ?ml%!EEc&W)mժ@!Y- -7L|lRd|bvJp% XN1e7^dQKp9 Tak0_qAc۱KfVݕ~*}vڒ'u;N3,HzOݻz[{dDHB* -[εjtJҠvk,dc`xJ̘2E`V;)=bNnU&AEZ!J#7r0*bDGp3>#]G:itF6i9Q,|(A*Z,w띑ւf+k/a+r쉇kN#}18 CWbJ[h|et&$K)Tн':?>Il|뺙pg`ѿF=07Ħjl%TbCZKq.(3TqUL MpkdMFA a&Nh-<@T*3Z;@,C|hۅ`M;:$}&|zQ _xa|%Fd|.q2N##'W@—ʰb*Qqഴ}r.SZ^SR)Z"Qȸ1"r0]8=\AVG#чӫX|O@%ݚlJ{XQ($S aG0 3u52];ЕBcײ| MZ0ܦ%[]6Tz11WpJ4h^{\lAi}t@0%`yIbݰrƯM*T@f \[)sEVU5H4l),yA[O*CkI4r TXLT\A_(2Jm&i/Z H6k4G0~M!|.>?-n<[Lo"|v=]L3zx=?NgC@RCa!(&~j1p4ur%cRޠcRɥZP{zčDŽ_\֙4?E߯5! vǐt j -aDT<. Olb`IS+JҲ4Y-ncV03ADX# -[(i9mDA,Q9;H}t6>9gL֏4-FZhY&9(@*:(=v4 1TW7FKQhRVoTQc!-quGeu'F.)S~;x{dNmo. (x+Lp XYR{wr]="T@/6@P)sa7M3@<sRv&*ZRW- i<QT k!/oBR\} 6t/ZH7 H6k&0Nzi>|>Ob8^tr:zp='}@Rue!(f0ptur!SZ^SR)ZQ{ 8&8T7_3 q:%u*yoMH!(Pq .Z*aD4<.3O P05 "in zjN"BPa;T*{ҧn#u'.6\'n.܏\2זWKw tX/YG w;+QxA -}$6 -VZfYU=ERZ4uנ,#PuQOVX=PhwYgy{2m!zui]+ھҧlB0ҏnx&7<<ܪ]p?Tn@}WPDpǤJB -H(ObfЈb'TW$dyg3 ^/LdhTReV=ieuI -V\)Ai1Y&,ഏ1,EBH/]- DW p<&]W42Z(1rQQ2wAd@ Bgx:Ò3>v#t+#-ڬaIDJN-r -O3aRrcdrkƮdIbMZ2vMKZ7jn-bo.0|t<PAe5:w̥PG7^r&^pAx)@R+0z <6YJ ?h|B[̍Zr[% y؀(U"55W7 9>mez5H/mר3`u0F}71 x:`~ jO3zpvOU,TTAL%;^?[: SY%2L?SR)Z"R{ =c.5j+:ǦSPPgПS5]R0hG@!ZX UoL`N -6`@aL}mʃ^bpI1עDɭ Wr &V)[גQnEq-ZCۦWz$}w\a QjTHf47ni1/[KV"eݤQ[SkdHbh  L Gqh,IY+Ď)wLL%rqlגKKFm|D$ l٣D~F0Q Z;*CŪCgBv"ޒՖw_O>Wh%Q[ ܳn4jDjӅJjRswCPT9>=ءxANK)E.5f O9oygoTao0_qUA|[ZRiɘirkbvit$@L޻wwMtVBJZ&FUnP2QQ%Y>rstGi0<0jGcaZ3(]%ѡZ龺AgVh5sѧOYX–(;|.L#%T,υ+*jO5LN-WN:ڔzF2O<%;RT͘J$c -pp;99@* 쀾D \rk!8y)a@ims]͙'f5#{_IV}cX^'t iD>ٴr >}^PZVIRŊbv0O'WTk%k#m؍ -m[dFQ*q+nc:?I{.nUjL2I"Aӟpm{!Q[uޢ ‡f;x,iC$י-c ysj<h}x2vFԓ ~+B:{ro=h H!L- -O.@cs@Ѭc'X"F%i7OT0R%!{]}m5<gQxV|uepwG"?n BBH~l]wtyd"Y GO7&apzOT]o@|XE]6DthRtjDDQH.-*" X -[\փnZXJɸC,i릓2P5c _(K~;y'Qw::}е؃/C.M%SwA$z.R@oa |{smND <Ѷ{5u6毉tU:GHK=^Ab5qDRU9f`hKz$}@m4$idcKV+LU2`yezeJO Wc@j'cY1Q,si|rs9Se#JRІ51hkZG$ Z0Ti5Kj#lunRX8=R8wg[-7օmט#v=jiU1Ϣ21;EiG(l $zs?>+^+B;ti>Xم|D%]" -vZݻ8\M&`Ө<0yx/%jrr,xBjVE_GLXkLw :`ZB9.>D?T]k0}Ach ݖ>پvڒ'q+NRFY :sjYy`@H0 .r0KвEe?X߳F=yIН,tb =B)E,NpzEREKT[ǵbXKFBD~f dDS8"p;\C#3d)Y\AXœjNdV<_@|N;2zKKZײnn=?>)]^׿p蒭AH}t@0%beUp&nr6m9) kLW)1չ7M3bH$y89#N5<*btr @,E|hѺk2M( ds5!| Y8YuqCp{̣$-Y4[m -"7C@RKbʭSvK[']a3<,G - -Uɵ-&)Gɍk*mGd Վ U׫S|Q(|ߝwS )uSn)3L # -.hI]yiuL"wVօUwCEn7@4ԬcUۈJv-Z{I[ҠHnx -8oc -` 9)d{ݓ(Vev,#:݃Z XIg{VuLUDKNsv+Eq gzvYHoNv5@Ӻoiw2AxϻUnF}W  E,(ITGBTa2 d.E+3+R1 ^r̙/M5p Y Z9!T9 ~MoeVɾRo)vG}Vbv0 ],^\ݢR##W1" Ĉ>|L9 8g@#݆lF-)2ɩERуaG0לjodqndE.%^t`1pj-WuK>S .OpI4lnw)st@0%`eUHRVwA zKp]6U hf"<6yЕ|$fx@w>T[ǫ=PbEX p}Ecqv"陴"7 ڄpCYc&/?%evw7pnч0 -`ݳaa HQ*| AH%3YOOVK'[a*2T^!;4~@*4ZK 3G)e׳xL{{ˡJ.] Ug%B - )~lN$Ȣ9s:}HfE3+j21OXmϖi_/ -uukP:Tٹb4IOk5(MML S7ή -(2EK*R87]xMR>N5B$^><6j`e> UH@Ua><Swu;xW>ƑF>H¨V[E{ttszmIV.8o޲}e$>oPMhͧ/+rwgE-޼6O%?H#qzLÞNFO'r -È)Ey$:Fh 1i9(wY ޚa4ap{;=ks7+`*$-wU{rdG؉je)qmZՈRs8dm~moQ;[S3@4F7{~#W2|U%*[-Du̗jtJci*әr*|NI>n"jTYÓWCW) qb]n*xd"Yizr"IקG/^9gY۬2Y)n⃘d6˰d)&Db.b="[\U"]EyS+LɀU׻|#bZHO& -`>ɝXؔ.ҏt]z%)Ֆm@K-PWD>!jw{{;II^,T~=>y9U_W˴,ak0Ɨw"YVp]&84QDm#Zv&3h -E]-9H;:۷ǧG/ON^_߰_ J? `ሦ3H-ru:ZlE*MZrXuVԖ :JMa? (N|I5/ܓ}R 5!D+MA4Zu\\A/D0 MOņV(N2Sk,m)KUt$ eˌpX'Erx|.!BV{M^;m?x<а`;l[Eo{\bY.5)~(%_m#qd7KHE2ǿN?,lMCS4: pWWINW3Z93f_QS,!ggjgOY%PQXW fGǧB|SFCu Y! -A";r8ҏl6חiVN5*=LJD8OPPI h+XA>W5"(Jj9DTL T...\}Ahiw,3JU T -{5@I! Йuݠ YvN/`RO*FA]a!CBKW&6b/EP}p;z@6t@s*WhA-~a4ޥdB!+v(_nzv'.tllKq<$\B,V3t$et$̈:D -ʟ`LLmQ NҪ==琡Bx|y rr_Zҿ41m{mZ:?*3ȁB -,#K:Y/x@;Xx_)ͦb -rM|b\/.H^i5`XEgq@~ICC0T@ߟ5 dQM 54EV ƙ޸Nrex̋ 03@gHU,$_KfjrGP&h%dRfWD@SDnuj6+=E~}s j_HM -'H@;ۋu|)Π:\N,ӕi V- -B^VwAþY@;.)Ň#*;d*xC;qtւ`2t%ONrQEC_ٹ9Cwڝ^vBJ:sD2] )ě,8UgdZٝ}D.rKFwf ^벦]\V8G53+}3A5ڥc@KOgژX XjܟR@wdp j#_ 1,+2*Zy^;zxXb8-=0S3ik~FU'נMpqlp&fDtxGXUL6+z(>}1a-g|&ԑ~ףh7q.h=1{LmMp?_4 ڹK^$1~s8šbP\YwTᵫ(cy7[[94eU=>9uV*gO  -,u=,~jZK'clH+lQJ4̠uxjx ,wrFa9[?=>Oѯf݀*~P}A%V*-Kkܔpwg7rgɀ&8}gx߫a.^_.а?+LK):H}b$oGGKTH`pkz@20~(xІZa>@H4𽲱aIã?k][c2]ΝH-BtuwEhMσq W韶^B$Ct(ͻٸ^ {Kp:[` e\L*-uTڻ+R gwb^`ݤŝ`#Dzo]e6s{e/%1H8e:GM\ۙc\Qk_-fI@-/k -8ܬB#;|8ed )v+`hUOERcm67'))B0[lg3ҶogZ[st}'u<[djT!A+X{iL7 K,v? fӵ|KCOvʓ'Q9ZKDAGsuݟqw@1w=D̫&&qLMuCX7 B3XceM͘&۴w -0q^0 .޻(lƆ㩰p I PNULWdv:R0?[yĚ4H`V9w:P YHO;Skv~NVX[WGZؙTB=9ф4'%o*:褔| 1 }7\{IMnVoYmPpfR7TϨ5FNipɷME v4G7eta(*&Kr+P,+jJ-gvDT&g$o>,Y `m+Xjдi²mQoSn2Gna;.N^۳>Kr?-I~0rŵRwNJA8>9o>4Q,H>̆:j:8jS4d9|-VKrP+̣1ߤ(ڜrȝltt[Tڶڶ25m@~]p*)T~ -Z9(ܐv :͠=v G}XSOR2C[loI0ml=쬿9MY:=72n/A%Zt̅|ƂSF7l9~i^.tsj KTT<*JCGpdYSrrgY+g`T4Uq%#ydֲu8HdŮ!blTqB,_DwOIU=<}}ґ9U@ ڣZ6HbBogêA> *k8~= ZGR J휂_PYf ƒiENos<*Ne$*-NnJ#D6Cy*D|l;rji_~71$KucrY֙51gq?HF3Աn̴褏pSq{'E&MejꂫgU}Cv([v\B+)iR^jbREVA:XW.>&1xoDrq_,|??"u}Tm{j%yU]Gd -o z*hG Лo%feo4mh82DEStvgr"Urp3#LwÀ*cΘF8u|쐋2ePClYv `q R0`NcW}Ǚ-RT@PavIJbt۞) t3 ͱjgp*𳯈3DV0ӡtȣ؞\vE%g#YFJQIp? "RWk̇2MdwHZt 啷8aJJLo%Ε%dGJ>8BVӧSR^'bQ3SV5w gԽ^&w**uN]")s̩1R\TyU Y% %1[?Yg(G6TC&+G*2ᑝ0|v@'72dWѹM9]Rh/aaVkјF'IVV2zz7okX98#Fd\h"[d n7Pp$Βjm Xh+0FwѿoV]C#/u7zZEAzZ3OTCz?9=s26aGvTƘ v=+;࡛$["7:+8zq L|/G~/"Ei*KHHk On;212{> -&Ecաmzp:] l>`^Tx n7Z=5$~]BԈe{k"B~!=hrGZ~G:YT\dzLGwMNvI?L3l1ɶ -ޠ s\.:#9L _g1Pfv9ꣷcr F O6Eqõivl<;"=s*pӖ8[U.Ѭӫk_j_9[5nz*`>e3 TqI*O ,Y]WhǜG}45a`235ߏC?&0Q x2sJȱ%6j4m ȠfGnohYvK'یEyU"Dgp<z/{~8,8zLkXu -)'u["VcQ;_ն6җ-qaܚ%^veƾhwѻcjL%'z6|ʖڼ < -E%Qx a暹ÿg1VSr՜ϣIAMl $1O E !U_S}p '2@CϏZh \9•_4 -9{:{@G\.i\AĠ\XoF**QL y|"_f!d0v[=6}1DfVOo.^ ci0~v"Ys`9>EzN㛤^GޯzmsX:oEXδ7>BؘI{.ūa# 2zw@?6v<XW.cs6곝 -,mAQ0#1,n?[řqY -lnfEh֊l1Pe™ȥt#X<$A/ <9o -HO1BTOA2uLYYF.H{TmIhAD,il=I@'5&Z5BĚb_*R0j1+ HxkTڇZ9woh]! _d) 쬃ITU9ΫW=Skt8QKRfH-A25u8T*.x5j->΁Ƒ0iᨓvN3y+ePԛC橥 M|'(y3MǦ39 C'za:_߾P|2C+t+o "`u`D/cRz")k3ebor -ӷ;[K?;1)簘â?2֑e)NȴW v\(֌RƳo԰6.'Xkb2I6E *_ LdP f/]k*IVNM$,E7n财YߔL/5͌$v`*d -UF<+53z-L6v$V+HND`ЩD} r 6-|L>66ofi Km3 dMAC}^`^Ue؀S J awb,uC:܊u5xؼW#-[i.D8Oơ.4f5EIUu?8Rapzh9 -IxME U0۟~)V.vu\;˾L $w:/6hNBXx55=`Nmyx{yKI/?ARC2ob'X `ξz F?o Aօ{ɠZt{Qp1:mHnej =녺$>5_44}t|ک]G[4j"t٩ikfB".:r|ߦ|H mg3@='/įCw^Fcj8,wRf6`3_T^py NU N{Ocr][R6ʗ*EL{+tZwWaU8ym(uRZ%zX s\ݒ`W&[;M?!ٚk 5,$L&a]?9.l1_j;bx5Arۘ*55x(Ac3xΉDfPGyɜxSlW<:j<|مa P,hL.p}k G.reZH(޺Hco>ށ&& -īX>W)+sJY)?*!5>#7^YIJޒsԁ D*OQ1l5 -WGhByd8^}kLNTpyۅi(Q5.5bee+Jчnl㙐uda͋JB v^w%4\O֠JkՓ3yj X9 9+2tW,+=y՞>r$e|98 Of/tc5KLb)%C~hBж\!244^g*f{hMo-2=vѦ^S%ɥ& Cmvq=A#x,ҾHE&yHe+5p=SPu@9lQEUG]/߇/?wАCHh -VW-'~zb3иZTpNۏr2mgIu&ĺħijԀA:m?ܩ'2\4ҧmoi9=#<ǣI EfI}-?(>~!1ć, n;!lFXFZ,Y]˘W:;tJg%GnH)^pi2 P4~UomI|cSbnZNH~g|%O]_b.rha(]4qgl8x9N\ 5L[N:^ 57MAD`%RKQ.2-ڱ&ǚBe\ɲ)H<7[o8RZiSIyYmo"Gί ++r]6&J jEV34azvǘ߯_lKIdcfze۟EzՀWp-bL4H_{(~6ϗ<L*ί"SSHeeL2Vt}g N2졙/"y9:#΍x -f)OzJ+ MT,q3>gٔd|AH12(keB v`w4D!Z(@JMwyh/!W1Fwѱe DFE=} % ,I~Zj0pGf+";]FoI̕B"C'k`)z e$Xex2o$T]C5#s4`{W#7f?L 2y-.O*员K9sHyR)c)!"ZlJ.{2ji,el4.S]#ټ5|!C<4&bJT |1! Dhdu: * 7  JSl"s] "4pe@-x{֑VL O0ǡg A`MOB͖\{D?H9u>2q=87`3GVO-mLSthSJbȫ "ZP[sF$i/.|6_i&z;K0^0/ʹ䨿ŪΕFKnS[X^ΌdsZ S>X&s#*w0r%I#5iM[JTK !Xk bf> Til#^XWec3Φ' m22I6VٖU##alo:O\muIڠsMˡ+h8^%~pd[+]i,4%-{V5Mw$yf Ww`@iK&)5Ғ=004aOܦ9̘K-9Z촳9TgHc=dbumDYMHE3Hw` -yt5pQ+k:e(m*|Kf]z|E5b_!<`_(?78fR۲3n - טn\+{=K603reZ 7*ט-58e%p} *;4 dꔑ#3eRxTeCdyCʙȸγ[j> -fy&EC ܫ4 qiޑVFZ*r ӫ6im׭Bނ k97"]̓[fa^zɕ雈L)WyrSmq$q'̱M"bbaMacj5~S-n䋌jM\y)$ Z#7!O^ -49@LYv0b,*}Gv 4elT=$R3 nɅI ̼^q306AˋsXZwQ:@ -sVГd_ɁAJPU<1e>|1mPZ[F55|OYmo6_tcu!vVEQ-sIx["˖Zl-swϑ/y?}"OO0 .b挰?S)L@% aIp)HR{ oxĄf112*F.d.bj:L)JKER9~HFBŘ5#d̘U? O Fk'a פ@ciJT,*ƀ#-OB0<{ e|Nq0 .eCD_A]ҁ(wGϭ.䚭v̀"K9ѕ6w^b9.#Ԡ4#dnLvEѣTI?Ȏ s-R5{`<]W)-06QB"颴EPM -"^]Q`L6y=]v8zB|L.l8^ޡOY0 LLa)GDY\VϓXgX^l0#f٫eP w.8OGP=ݔMBs).HhGe fda5 0ٹ(vEt,g/\@gԕx=0hb3؞i;ʔ4aU[-S #զ+>N_ChN~ſ`拶8J|,{ÚqAyMT1zsy|="_oT 7(]R+ ^+?rapf6O[lխA 9B|Uc9t@[b!bǗWgWgu]b0͟2Rz^=ޝfpiPqz[sr-sp] -j43w؍ !( -+;A`[{=oq|63i?x3+5 -O+$Y ]h -; -.ϸu2)%fh7/hѨ"jF,ox|/Vjk?|Q )f!_>|ojOnZSiOMܽo|Zs6q+)գ}qb9nb7N@$B:ow $;1Hb]9[/G/ vFI0K?wIH\,_H!V"NՀDfrAv? lt cBŶ@f! cx"Ap  ˔%[P-5*K+҄-[!Ɍ*1z *|:0'V5^')˔ȩ3{ ) Qf7C$2Nd^x?c4] vIA"CgB9H(oJ5H)- -9H`x:AqrYA05jո~8_{׫O7&Řܲw7&W7pwίÙ~cLkJ!ZT -de@o1"aŋ/[$!i\ -V3pUS)Z`OHID4xp|1+_]~H$TI򩡍v%sp'*GXTUTXdER)3D6W<py2V 'S!<`+ .el -Db[fã+peia"'i޸?+^/fڿo7\ wCklÎC|L\b[tX"܈ذT]sWeh_nJ,hQ>~D" N|֥ڂxclSg|X1YP+$ thVYP¥eM0DLf6dOj$Z7wZdP>"d %WDaDQ-IqRM -07DctT~=oI$Z&2F J=oKo0jc31%\1M'WCGmGS{y8Z6dA οâ L&[B$DEѡ30BBrGJY H;20NS4MXTh%7Me3M֣FjT买;2DS@]g|.$#\'ڗ waUK tYPl(K)R&b\d!(wf@W"j73o$4AxxaD['+ tf/R>͍IO_S]{w(:3!^Pwxů#o]f -E= ,KNR@hPH:3`$2)9x?ds-!]`cn(H5/~a"X@ɦ8zpDt` !)iL-! hPL#?8\4aLX#|>`ŏUPaP1(5mWНALȎGrZDpڄy:> -O9zС@ǎ>k.7NSKȐͯxkxT@U_T+]\.2,Gp֟wj9l A TL=N 7UJq_zd -VcIy^9)GbK]i*΍ij}]W;¹Ob -xAc y75jUcÅ Sa] -tHON&9 *5"k -fTzky:}VTw=͸g7$'Yݪ̸&kQ9ؑ:Cw"GnIV6ƣv8D%/O\ &)BЀǸ%86j7 v[ -ZRuW쪇_'|ЦntR +xb!T*QΤeSR`l$ڪvKٖ~d]`oonj W:ty ٿ,<{gJaǰdCCGި&u|%'t*8h?YGpҭ a΢i;jz OX*-))6{zgaS}V(7򅨯^XJŊ"GLĦ%Jǯl yvda:yG(OkysanӽM -lk KF*S -T.*p[%d?)L}Nq|q])m~FT&V\\{})Fs'#V?L -αX/x.Ի˭@s2^:㊰Б[}k2Y}[ZS/lXLUm9 !f ?EC?U)hテ4 -s@gW(wgRN͙ÛCЅWmwuړu &g:^^ظBL/glטlO̦{ ;mjbFGks6vF~T$n\5ב3NP"$L:KowH;m#7v`Zϟ]r6ͳ2J$rM<236M#!0!~J<_7h8 V2&(Q[i@kQz+>MfU4laŋe"P-Py8%&8oĢI^`ae @0VU2h -G?6R~cE2]i 0 é88'R*YKYaXҰ@3iђ+GhA1AR$U)-$Id#h*ɻk'z*r0rs\(fh3ȋR:\{ڗ P`vpX$ͳy`%`52%{VnVEKVZ𾶦w|Ui5^z|>>U"`z.P'h|uh;O3ŕbb jCo](s i4cDpQ]6yĀg#Ezhjz,)ixJnRѐ@ Ývs^-d Ad^lZpd"x)]K&[i4 x$e%J76[k^UQeA%GLwLӊlJqJv '﨏w`{)"dɲ/;j~g1%X [Dj<^@m0F$&lԤ&h%yI艊[ zQEW2LDK+kPf5-,M"ɦ+q}ktW{iqD>er6vF&MC- TXT OԿ2 r{!<=U0Zb`o lRTtdF[.RWDbUXcM{ѱl,Ks<;R,ey{-*UE A8']'哬!}HVU -ȩۤ jTUq ^Y@I7MwvmzP-I,־ںe>;mX{cwJsIj̛VNu|e.hzz 5Q:$_xrocm^NsdOA‚4E3y0""NH@H]$Z#\D:ڈmڷ+V}ZDkt ~q - >A1"Ea͠V`;ZG~$}].|vX -h B8nOg!9D ڴ.CyY[Od" ,P"H|;2P+kltt=0gfS魣rS{30T\J2z'qP|׎'8\f` : DBw30|T 9^Ք|5w-C7H -z34%^ vdvH kNd X7 lfZF~^MVM ;ڹH]pǪ`(yA"WԂoDצ`U9#ņT w8xR誰T!Pfggf7}e o'&y&Ev#q `?VɅI ^VEn$4K:˜41^ئqV(џ@H^8 wpMm_/hG -zV.D0ԪS =}K[ T)[4fy'cmVѬ8GxZKbvYQ &C&m[,ߺ ->СZYX΄ -s}Hcu$t"!\tf[WQRN;qsԺͳ2_-^['uNSkT|P:uAxouMW3lK/%TVMVJK^Wwi&mg6-)?z?DPs Q|\\x=J6UK?m㼤 n(j'%>4r%8,]}ۀ}075NA_f2Eb -=)nvڀ#DU|6ɣ|31§t0Hw.{i~m WIsx3 PŇ,o|(Bdꪜ1y;hg lLܵW硲@ K3Q\q<*jlRNeӔ3>[xp6C 9~9 hf`P>p'67&Vnwk$:.u^ߍiVSzV%(?DV'?Gdv73hWnF}WL Y*NF2`) -ewb&ޙ]ީk(a[wng ۋx_ >p/B 0+JFZ|jX3口81s - T' #}0jbT.M{ #d+'mʅ"!,Pyd`ʹ5?y_&}_h¬PFhHK4|_kB {2* 4JDfez-b$RA%s4D] j"i Ѽcb`8,v1ˌrYfH~Vφ4M<*1뼉B5fD(b ,ƨF۞ŊĬV>9<^abmS9ik#yTX Fbs89Q\s *dV 6<]e;L>i6t$M$6Q f~sEɔ<@n5<*A,`KЍ- knY1=cº؄*妊a6#)J}E#"MHX1֨ض@@_`]a5i6'v.dh.B_cIɼ-LjQtvy5U"'z+E32FcXhV2 Vf#}he`$ 8G9 iZ%i C~'",ȳ6YXtבrO=kč ppЭ&)–,n^__Q駟c,i߫f"Sn/z1V&^ TAvvkRvc_ω]ݜIU2{ukU7ijp3 ?l-,V-R>eIʝVW^Ԡlb*t'J\݈łr\ǨAJdג&M\>; RYJ`As*AB<,lrGiG3IE9籿N6*ZcR9ę7mFv=?L=tL*@jJ}i":fmޝ1_T=@HqO̴Uzz +MnHmX߳@,n z5>}oi|)^lR?1Gqxdw0qÆ)px/E_0Lʝ`*5ݳa\IO\1Oϲf·/笟*7ovB8k;DDŰHjɫq[:e+ܶo-_ɋWMo6W =$ *zmq]@$ӂ2kTIʊw{5R87oҿ~ y~VVNH%Un+.ZB C)(> J5+pk ' h ڴ(ڌ rXrv0G駳V3i8H5BVJdEAEp\Lu32_;ЍBcײ\6m-պu(Wu cKe3: =KR%`eUHR _B䖁^pkI4Hx#m$|&ftWZKlSKC/w *B%a-D !U>hEoӞJ/ ڄx1OCx,/q|w7.&7slz=YLfSz G5^2 -*ERɌbSj }r%S*OrE=Q)Zݺ|T-΢5]Ր~'L0V*ܴ3Ok&ܴHOkMB Wt<~ UaoFίED^;5HT-lcﺻ8vw"yof]=JGtNWdJ Jm - -;&#ے/*mqJ`i* b%ZlFWjOjUKk=HfJ8T^B_h]~Vk񱛔$QM{g_B@&`1(ŁB T(^_e%a|ynjaV)9 [fTm0p&lV_Ōz~O苈:ҶޤJ,lo_k0oon"滗+郻 ȦOv qJ?Wt7h)"7h$?gL@l17&;>ҝ}YfCGEkma6FeagplP+}opdEˮ=؞17W)^ -1de:aԩU{?pK)/M.A+M [} .ñJ]7e\cJDv={(;g=,J sy. <:m $rhC o<" (k4oYmo6_q( -4.\{6flH]O-2QHʮ7HJFZ=w Uu6~ µ*%dF{whgJ9Ue -o,(]LP42T"?3[a%\Z+|2~$V-j2Q -+ZjF3)Y| ,79U~g`D+2-J ,T;E/JUhoN̮'ѕ1C?~s<@BG,;CdLV"uU*356㇨,(} 01?Ջxݎ[?077tyKFZYbBTX Rl)(&Z.$ ij 69z4t~̦!}7o'7ܾW7 ~}zzCʒ^;|J-1OZ E- - HQIVRdX+Ϥr$zǷT%?c?XYscJy2 dtx̯R!c'_I{Kaa0ʚ#0`FQX ,͖x|t\^5x/<}>Ʌ[ǥAZՓ{!䲒G^t1s%rIbj{~:Ɛc"~jc=>=}}٦qEVЏZ!u2YDd nWAcb82nbꓺDyPy'/!u0{RZG[ NkCVPhQLh2ipߴ)5u -c6E! "Wќ/ͯd;pP`iiS52hP~Gr4,NޓG+1Qܧ7qTWL!Hk[#>C&^1ؑǼCfxc)p0 v-8W ύHSu 1s7byn1I|¸/w|銍PMcC<\kX>lU3jL2r|<|xrFݩ -}q!q:w}{j>i~׉!5v;ܙgAiqѵ?ԧLi -7Ȝh'Emzwř`,Lv52::2?޵xa˜ iSue9l~os NSsRƝ[w'14V5AwIl~) 9S)G.mT]䭽,qADSGZ bxE!0R6ʝ /TMo8W =mIkۢGZID$%)nJ]-|4fVE(B*j ~)nrL޿,h+QR9,P9,됙Qп\W~a{ER++Z -9*vڎܢ+-bʻ%@ʯ7*tco(F:}JZ~NX [2BuA -k~["7mA3֓ xO0N^_N@iSuOp XgZ)T'vTDxt yxo^&0 K/H1yKʮ:S-:Gj}%wPbGX[1à`IqU/8E$ZHH6ftWwg>d6!}xH>nw6۬ -G7[-I2je^V3?E iN`!+Y=UFm GdIr%oHG.5mV6dONIAN+l1{< ť2HxǕwlВG{q"Tѣl|4H=^ybL0NXغo@2DQ{~n6gpg' HdgѴʓr#4.~n>5e}q0nyPQEiSL otAor$u} ~Í"\gq.%VRH,gjt8cpJ:LFVB#;$f*)n_[э'"|GӘ^GX'bWqr詗ǘ9 -޹VnAV0 h6# QvAB AW4Z3>V=Zm`GDK>ZD>T 9b@ -˚KYJخp,i=覗r7cT%1m`Шw49J@iO֎.PGgr@x)w@8Fw~m΅'<צGrv,^sJHCo jb-q-E !U1cBpڦg$t&|FQq2wQ'3&Z"֫8+z[Bgxu=$(| iidkNf$O( -H[kdN E0%dG+պ>)a((0߇))T2 &O SDZJAVuC?- _.|rr{sig-(o -t]a8v-ǕRW04ƣ;䘣:oJЯuQ -tf<9 ApqTQk0~8.{\ڬmYIXž8Jr]oN( 8ݧNΚ]%I -! *G~~m:ե.oE% qJ s-sT pCӒAVQ*Ah@h@+lB0rDikTN2DXӋ+y/NH 6%(QD0uYN;ykǒ^#C1NX[Q'x|kуZtGtXTRg^ pAx)a gsy$]M'<զL*Ȯs*JC5 b qD m0qE IqMų ,O,N.]^ެnZ* -.t.63@*ύa^(G~ --Clʜ䩲%B!irk-,tTSPx|$U0ٿLHI&? 3LL$ -=O a%<2y%uk՗D/+.|v -{GD3o+t.;ZGshjVβe7ޝM%r,Q1|{4ػ"V}(@ɶ -s2t ΍m<įM!CUo]n3<FcVn8}W <$cu]`-"r["%Z&"ZD[Hd3g m*@̹s?'W7,٧vvg0JX+Bk 5ϘN0t"[YPڬDJ|ڱnT٤uCF>#J+8d6٥^ He4|S pغnkc /sZfɚV>sJgO1zN m>ʜl] -/6 -DbYEtr@Fe#kE[-i"{icF8I»q<{y2cqww|rf|2[O埓u8RS) D*Qc 4u2OR$Jq#גRpƸ6`2Eyu2dw~ WMC͕ʝQJ1TrgY-^й$UZS#$LQ.?1 ݎwGҚWΨ -ٲ' 5_Eٶw~@'uwzۗ{/' -jVMIdL>ɛ9iÇ:vlsZ7OϚ{"'9'E aIC<B%+s'ZC:!.7ސ4YzdSe-؆#"qXm$I7uL\{>C6k)}o5`͒5J0VYh%zVi'8 XA:ɹ|mHr%+_礥_AXcBp UHpfx|m[a2tcoIjQأ Ց6 ]k+tk'sWmo6_q0RR۾%uZI0cnb+ZdT)Jrd;݊}(0"swg* ;p W"0, -^L˄ʳBDƳA´$ 4H+8Y̚)WBFϯ\8IKTκi+S=snOgKevrZR}U0d% 2ZGHP񘩐 dQ"^+9[P(+vYu#2F%'Q?@PϬt6Ivw y"XX2T"9`6Q0C2&?YRC";_>F̛,Z#ZB!  -}Mؚ2he ^"'$= iA.b90wx>ٛ~=.&sd1M -$dzq!CS.Wz*Q6} y9D$ / s-W4rR-HTK*M|x+Y$!8[H4ա߲D`pnm7-O9M&/G#X9>(&B[9VZǖgFd|]qW.@7܌q"c"%SՉ"bm +3UG!$@qр-B򢜅77^Q5+i$N -^!vL:GJɵ+_)Jcv~MpXPC0P~ >=I?hpU -#%h )쟼63Ruϑjt;G%``"l^>b" londlV:G>짎8t]p[MC#^'`%% Բg4ۏՇzH;LS8,Y`dkcW]8W ׯ5c"[VpJ^xɻ6 |W񴙲/w -cj9SՊj(j?t*k ,[W{kس͔k{j#P[q: }4Xyl(-o\{-0 b XlǩCn? mBQzջ\|Rtwn__Z_Hg;oo;t_j= R0qB~׈ _&ֶG̅L} R j/;WmoH_1WU4BRPZ]t(9BE{f^Wg b{}y}:fq F"PZT'2ڙTs徟y¹j;Id ްR' υpcr Rzgp|m,̌-<[5=H +LjZ)|?^]%XB+?E`n-LДcEE -JBV&ƔidUԃkiTeoH nB00b d] uu q3mT:;Wk<^0H1T̩(F1Xq4IiY"*eܣxtM0O;azp>@46AbЕ,%*Wb }rDENrHH̝<31c<ʑVnaJ.ܷd1)k\ޕHi?A0Ooc8d1gr˘j#_ 6yJÔ3_jֹ`H(.f,1|햩u[5Xm@Py82S~NɴsJOmѥ$(J U{lg dyy B 4] qb T3?ODSaExX8 8'걜<&K"4e˥Ո6#yϭr3?7ҘV`@.ö]+oy`-p|]Vt/8KFi\ קk,BD|i 3L6PŎ7H`sG0BҨ0ť8:B8kg bQ'L˸!!4s%*IVÝQF~jͼ*e{m;NpRw"+ -=!̓0'tUcdGt1~d@~חOϻ}~*j4k2$P,[V\|] hqٲ^`0( ʕZLEwRK%?HQKsuC1p%Ow,yqd!cU /^ɓY;̻vgwV GQwd}k(">$I3#_?UV4{v Gvj\SHd\cH2`5b T.G4D)?6 -R8m<7[@,5d/x1\ ,JBbhٕ>0υ93 b4i\`y2 \xrA;qGDOcS5d9U4Fx<둶rMP-4"^@ؘQdI^LF|]9pN޿?_&pNǯG1~3i9GN)RArO.ꖢN*ų8Ol$ׁl7T$}S\o z)pa 5Y.AAr,O(PfH6xZ)="@f]bwi 8 ֌{L^̛;^13l҈Z]{3 l&[|~O,KGW[ ݔA(Yuk "2uZ?t=jGWsйӿH7bڸ^/ /=o?׶/$/o6sۺm^Umo6_q08 \kݧӸi"r[I&,IEI/uDEXKLλcA?wAҶ27fXSmJUāb*;KnA_ WTXMR$%km]EXoDߦ]Do@ecGqӤo4|ގgM[N&0}MgoT2JEmE1S`IטDO + -yGZ1`"#yT8Qiz-L{mCutWR☑ ;+]Am7VbZ6i*HjRQ;fSn7S7f hbx> J<.ZI*ـo޼ño1P' gsB@{\oUE 01 J˩j#`JYat _S88{s>IZi.je7B#\2Bo2}E *GV2}Z.KK/RD3̭bV6x;J`#H?\8Z szDPc"tGj-MڬeA\2$cjݪ*Quޑ#.c6Vg-Bip6RXVR䑳cP*'jJjnaٚgf -PdJ&dgGtyh 0^nAU$k*6A(Gb < $hiZHJon ؄Qw2 /&|溜_.z2[L/pu /fՌ]d-^ 2 -"(SɈbSȁRɕ<)En< -ԙ4ƍcG&#aVmaJܟU5X Rgbh$ ]$[ -m{%S̨R;N:A^C|;DvJf< <⼍V=xk=Sc!`w";TM^b D$vnD[R]pbjsLwHi6 "ho 1* #N}x?.^٫(H|<&;iZ|t8# ?V%qSSG-Ja[ {VPѲ&H[*@ڀ1X#[(64:(Ѡ!(OW2Ixg8ܮ8Xh@MՖPpJ?s4=Z<<[Za<߾1KR~jĿ?i+S^#~Q:=k}nn ox,j|sϷ}kr&YN+T*U%6ǯ_ .GUw6V;hGhKiB{wN:gwUmo6_q0ecۤq3VC(!LD"5ﻣD[Ӣ%(;y[(>9ejTRV_z&N.UN'H aLQYi7DJD/]# µU&1+ -[(i}(ڈ rXrv |ryKBh[hsK -%LrjQT@`.LŦZF+YQ9\0 Rk]w' -%>Ȁ.vP[F|HrU!JwW&a n_ -e coX9WiFiǡ1;MN t -8^AT* Z;@(C|6ߦ-i"7 ڄ`$q2Iy2cq77|r.gd6kO矓! QF2\!(f== OT.eJ婼9BɨДZ?Be$R:/*ˮ{) 8T7Ss qq)%?'JWp|EMd"[ .P?pLrq2bZ{Э~€w(aDX ?̓x&s-7]w`+ X5E"0AQuf>_̴!(ǤK:|)7U..!2ZcDU.ظڀрPm jH@L'fZsPAT:g`wkh/FH8M]p%~J/Zbdf(uuWhy|Eb!r(g AQ:ЊDAܑ 6Y,7h>a3{􆽻>~B q׿iGPKr-(w3dmh1͹#&A/f/|RgŜ˙",p1S0eO^aRb ae |TMٶ}?tF^nޏk?y‚96ܯ2 vn`M6^G{jRf^3e9 -Xx$\s6jy])FOp9y%&'PIɡ6G='|3' &jﱩd {2,xǾ+;gMv{J;!ku: ]C|ewQ9|I]Ysbt` mPbiX%ET̪1$//'inJҘJY,A!JTDRm%ĽxbVR?1:0dJS&=-D<F%%A<3pyy 7h ZЯgA޿j>5ZS[..f8SV'GD\FUSR"#YceM3շEƚ2՛) cR1:XZ:[gCx[m͎zLg=^`ݮWCt5P͹IֿKV[ÈsoO/Z<~&C)MQ@Dgi4ҍqF,s8_f FsD{! -3\CΖF)b9:Ǵ-m2-_a+ƯZ?@BsuV߻3f^@5DAtpBZOEyzS1)2;KYX~AQ~ppekh戃7!w9$]rMۖs`{2..k@vado_l?D۱w|$hnׯ -+v bn(!ȌE$f\,م֕Oh -y^{}W -\B (}O}m@Q ö[[gE9餷ݿ~C/ȻpǓT \{s7_djLʱJbőu$ĵ\$g= fDs}x 0/Ҋs[Ww9@w?4@}z>]F`aYcA @MOΖ \3J3"6N6߲6`o&yޜ~}~=e7ً&W7_g P.$PbEIEͣ, -lމa-U$Ѵ{JL<uGR:&iӌwSc޿w@l]~H$dZdS/0IKXU‚e)żYǤ5uE3z?E6@PX.>&Ih#vT#SY4 6|Ԟ'kV0/'Ld -ddmܘIE߆Lo1{ +R>D#v`0<1TnEN$TFŝٓ#CƜ¨M"uk@dAr D9=;bg<7 e}YFhxnk0 -*ȄsD @u}7*yP0*ۯJ@_m}7OVVW FRaªXPDɳ pA.vg(ZrZ #  -F1HO4n&+1qB+2ObyN~qy|~2eiEVEJ6Y;J$g?㙮Kg胘 =Q`z.BÒRGdS(%Ԕ6olzM{J`U3_QUD)ꛎr)8jZ[%)X:蹊UUC #>&ͥ Z&w`,lp6UKXY51hA}zƞi ܯ'+㭈tw?d<^q_9-O*Qb.5=ٜLMmhsufgm΀<>k|/w]A-'kfQ_-5 tP0- -q:RrauSZ^Ԟ6Qn{|'tmqHϰJ+!۾[Kgو嬥Մv$WS>ctff!8ۚB%vխ01ne) %R Ns:l4:\!iv\ rjvu&j&Q \pI"4:cILF3pB9#4ќ `4XqˊW!Vzs(ܗEg4 -߃D oQ[̃QUa_ձx&U- gN{ZIR5DydamQbgؚᙩlN{;& S4Es-d[_[N[rDP}ԽULګ57w -^M X* #^A$kA(/*^qX v¸2}>:2N֞fۥ#M3~޼zdFUYL T /I0D=0X|2<]j6*\mMh~QԳepRq nS,67[ZFfx'}r1 e).S)Bz4Vա!HXw-[w<#CIMWKÐN]7I#gFeP:Wװ¥,%"M}j}N!B,M0J>~w ֮27l@#u<7d\cIx[̬HK`EC;^UB{yuDbtf)*)Dv-s~ū~g> -GB$TmD/%+:njfgVn$ڡ̭\x1EULUKwid9ah &){nLTȜ(5$-R^?ig쨂D()R,u5ٯ{( *J%-hýAQI-@HI^uXj!`ˀjپ {Jә45V(Tcv?M2 -KLhQwG 5C] < -S X6.[9^ -}E'Mz፪Q3tusuvfЀ6=+[{(Ęʋ4NcvKW)cϫ4UZ`M%($:#G“|݁VHa@'$sj}|oSRƍr -jmۊ&fKF㘾#1\:D嘌VQ̻nv;y:i$WSN+ph"lC=i HZYE ͈}/$~< ]bI%ꆈs"$tZnU?C|[&p8\A:69 -n&`򢵲=Fh%fiwJGT\I-`<^Za -dh[&9K[<᥾{-rhROť:*M}ZߥRHr0^^O6&i3sUiࠇZw:7 Q'-B霠2s)N V9 )eKMNAdӣFxdEĮ(ގ79Û;PuV"EӾcnxS)Ielvg]ԧR6k՝ӳ$mtۣTֲ&ߪAοtoz]'- 0ŗ_D4Tl%4dHG$ȱA ~Ҋh/`bjҾb{/ۏ{t7].j<,3(m  =wOt@h`櫨px/dh mC%ւf-2nmڴh [/8Y4PR]7)94-m7Rk[lj$Pk^`rOrF׸kǟp/R{ - Mnև֣ȩﳛzFQp@%{iy|#ƙ --7Ngܐp`owXYFp4MDfUo[uS 1UE&Dvb]ARKc}y'Jdf}6[|l<еʷ$|Kh:l  fO;.j-DUg*L{>u\ihy:wg[SG_ !RMlS˒J.jIu;~=3^Ié -#vgݿyh =ځGpz0H, Tq8R 8r(9$)gp(%KK8`*7 {6:)cI0|cw&A C QLj|PX?u,dc\0өKn|&r.)*ve cp#7&UFV [*L*1;"BФ]vw̳} L U2ΑQ`~"px.2aVYqf"Ip\ <Ъ8|8@휷NGk7ucd"B1AY=$8Pe}lݔ͊hl]lt1û˫cxw㋫K.|&CV.%I]@b"3Ay*ᭌ9)""*r 5l..'cS4mah ڬd(sAko+H -%f, ;wfN{f]K%,}VɄJUkln|Zv9ؙI{:6(^᮰1fD!k3 20Y - ʙHDWZORK`Àɣ u+%ia%[0kMK_N4+U# ({0Y2zK+1`_w-!Ak㺐-YaOe>AbV|%z_b%ŏF0gXKVzhfr@?2Kn)$E)hv6e(ٲpt7CE\, %"I:ضkd X{S{-''EzՁy,ypqYw}եS Ay cD|\02Z9 23r%V) ɲԒ""B+omhWwrXɨ%Ar%G/Ä^~ -b5]Eʔap \,(OΙzvӘu>FCҶN3|J,e\H#N|?D`B=l<^xd6x LEM7T[|?8e<)J*e;h6X"yJPeo\;ף..4->]Nݒ -TLج1mWEkR3ɔI٪ 莙zhyU(79,KB -i`3]ލ\]ej^;:-6o#Ew 42͈@.;GJ+\Z Joy^+:x -/ Âǖ -S!&d+`4K AZ:dcӎ|uӖލҕyQvשY{YMpFL]=J٤kS3ŕf}a}=ijMDЇζS,h.US-6VU2=[~4B?ጒ{a6:NOYn }P̩C9l5vo_ -O+ө/TEBt"Kxq@-n,.S% TUzv`k|-5K.!-}.>]kgڐgmT)}w[U{g*q\4%ٙͩpcJ}H|zovyBs0ң=:ˇН_nrvvI- FiHBNxeN,[v[+'2PaUW#PKmEPuH 8T=RraօmkvъJn'Ӫٳav+y+r`Uj+rߜ|Z~պP)U6ЇI3xGLȋ^&tT\X-'ӕR 0 ES.]/ejst$XyB)}+YR朋R$g -H6͞.?nKoO_ @ se~٪]v@Z,REQ_lkG] veo[ aX5 ݏۯ1Q8\PŴAtO־=R;.1C ?Ŵ M9q\al &n$%!#2qjop7l Oyϓ E6I$Xkjk]!u2K0m -Uu:˒7nGL+<*{t~{J;qGo >^%ϖkĶA( bq8$ԁiNE4tz9L=y<̇d~ߏfp3,&)7dn]SB%My<9-6Ni}>9 9+ WRhST2@xlDAi6%oʦBHS}H<,<a;C͒ \iLy'.?(SYNNѮ< El #ˀ_ӛi5h|]TY%y 0}[ՖL7TЇSmԼsP vq'dA_6|FBK 9S2>}~6~w6t")[p<6z_C#Sx8W D8fnL8I1>1;l`FEdyhnEO0J B#=0s[QsfOE'eܧpyҔu;<,C: -S^EU[ 6 @ 2AG`W -%շl~|F'V"K۰= % ֨LI06ߊ(툁"瑧G1PWjfee9vHKf벖#5;~8m[Oa2Ӵ-YEc2nL 4`Ôb>86ì=-sR~`~|GU4Klic;gߵA CkەU~@}Sb9wq]Ues/y¼ɦwYWKs+o>N%p14dB|SL -c_a#֟X҄Q -gVr,Np'V~L {TϏ(N}W`t!Gh Lq*6\G̺Mmz@E3Zbˋ"2tIs8RX-:'f^|@ҥнh%Pv`9\, $ Gp+J1+ה][]9vT -ˍbLtឡ - H?av\=i|[:=w.]Xhf>zA)GX{Uӥ;fVs387ġL/4'fl]r:=A;}-bz>/YmOHί(!$lHFvnѭŠdv[Izqܹv_UuNz^8HtjJU:; tDy6DdYwЦT$L`5o\ .p4VڗÛ4SI6QQ15RejPJ&?^]E>` ר <I8VZ$R|0gAhSab2ҋQәLfjF&9-ҹW7F@Bz hӡ{9sT[3YRɅEqQ"Q"x׮21y zR]nY8eO=mb7`x}B=DfZ2h -eMĒ<Ȏ@)-N; APuSi "^]f!v؅Ϸ_>`t{={r; \&CVyaH TEe\ ESKJ'i8%UFPc,UF[k,~$R>FZ'Ó~_`O1ŴW!^]q$)2A+#y X9FS>#%, -=r -k>ұ_>kkM;rRl–Ƌ.r@GCؠyre_ZYE0WU}^+Gm8b/.w:0Br"_$Zm̽Gq쉃9 hٟ]JADcHD'& Q(f"F'lZ$ EW4rͳ)xN:{6eśHpwRlb8ҹEOFٶ)Q(̧,C[x/"\fWMqr|Eוa_3X/xcf`BI  - -0Xf:Y>_xB cĪMN/Yq%QI`h7n%ir:-X;HS~ME>;9P'.mD܆P_ l?\O/8wKYAlEF%.gMF%x@Oƶ*Qf ֝wX߅_%Mi*Uc#0ShxxdwuBBwka#ʺ - UbgkH ɷT ov)MǑ|*bu p(W0sZLžFܤ $%N$d(2hˍ5w\p:ˌ{b"Pʨ)=Gto;7adv}]N gMcc%f,'NbB,GI -`͝N ϴ݈\ڙƐM:@ D3QZk`̷͔߬\GojcѨu h(["e]g<`_Wo7;}ÄB1)r\H,N#"șj6Ia78IkCHg:RVv`KΎ4SYG`˼Fﻤ*nWrHƶ=,pXuve׌PсZJֻBu1&.BoJԫvkSfzc5P/r[S;C8bbuLөo!  LNM24(:*8\TNڠݤQ_kci{߼7Td+0+V{DŽگS茌Si9I(,."P(t~~O't텒2𨽝yz=!g(Du -Yˉ[:iqVpG<kM<#.h*KEsC7JXl/+Zo|}_Sf{rcNhuM~mV )[禁wdh朖[?lԫ/B&?-ۘ4m[V69"V&A!T9tլTuT<>QjTIs$jqSlyՖIGxNAYib҅ -Í`}*"76Qh7z4Si1ڴ)}L2 w{y-w(kZ]~4|y?{_a5Ϟ:Au& upmRwػ[ƺe]46+l~lu#{~ś~ږ)n7TY:(ЩlE6 qQ+Ú!Dڅbn -&}HP %MB$ԅ KO~V?.AfebN./?_Xmo6_q {4qf fpmQ C@˔MT4;&]m{QN_f?:j\XB&FD%s0 "Mt̨4)N,IQLIY<!Ȕ"pL,tW]24$Lsk6WbK=~t=^\BLi+,P'P1X#$˹gff\2^ M(wF[,ƺJ J#jFQkg:p,+HRv -X$di]e}蔤SJҨy !i0&;˲ v/i/.ֈ߅ -D^bƢ rE#< iILS wCo^@| >|N~~777r 7pq=m8^>oH M, SEYOb˓d"bxɼs N\̗JSj5:9Cz,aRi݊W+r4IӘ%^9?GyGx*b:-rTKl"4)PQ -D.`L9fBdVoAb[tOTRʤ>/akL8$"}M;f! XkʓWxzW|Ną.uJ*x0q^TR83IL`*iK -&|GT"J(d)Rɠ?vڟT 6՝ ٪B Bא* EUJ.w74 $6FUNU,BjM'a3-.[[ؽJ#x[s_Ww;;ndHػj,lIA}b+mh,M CAEk\ -CD̾Jj$VʡSECA.3P.T@iC},%-Մ3z-z0?ocES,MbWh!K:x-Y,BKTՌT=c lNg#I>-mvئ>@4Lgr?r1ʻׁCk6T66Х,{j0i_p`5]Y|R2wpc)$ rfLoEp<WCG%9p!l I{BY@n0n -CF? *"P}EJZ6TF0=ʡTC:,\`Vii#){䝳NĹA"NL[JC~EyH&T%]E5^$.vQ{);&Z$d󷷴믫ʕdq.6>W*xp{uT8xn_u->lj~劻V+\̘z{nENUhZzQj  {/_CKf5eޞHC-$dy+s.Z7/Š9AI6IgֽB}^!Yqd^.z5Ӌb:Ǔs";Y.=Eh(R<A*mA( 3pjc˭)mK+EzjbSEiFr{L3q -(D;Nٴ ?e`}akͽf:.-__y=ZϖEQ[tn!|;L' -%;Oc7@]oމ+3|~*X>f#/E9'vC{w_~ԜevWnq$b-}Z/XoG_1, U?8vaːDQn9>n1uwfӶ"$v6U''8+rdfDpF22׹J)3L2GL<9SdAӿ>r2-Lr_N"Dq> >V|zн1ZKЎ 3Aa.QcAY -"[OHJ$rq'bJ*}]ܻF> r/PEb:_jg{IK">3h.6e:Ư^QҀYW@Wɀ⦿cffs>75!U .6?bd{S4:|R5F\(hlVEllN@+ -#%uiZ-`ؘQ:|4/Noн-\\>t>]A8>ԁcP)r-Q)@hy3н,Y!\٪q5R1ƂJoJaHxwl2DpgIi?Bx~Њ$i+f%ߨS|@Uqye=B;0J$n,@c@"nT#4 Q˾R<6c/|0쎜W>F3E RRp1Wɩ1Na,#wiAU>ѽcRJB0v+c 7̈{; O(-,+fpC_w i$l5ʲl~Nb \"ttZBz;a{ ,b/=y 0pGHGGi߈t̻^֠s`Ӡ?4ei>W ;q׷lBĠ$Ą& ֋ '6yO3UN|*x\M?&,%A3B%f޷q}IaVPx!VH=w s>*!SZk9(h>%qVqGZDzkVLHio+s˹,f?9*tmr%Z>po|"gF@eqyYdO!-TC,+)׆,Oi0}@X |8S {);#goe ކ`nbߞk*d1pUL=$tBdŧ2KqD,fmдv$,!UAO4 0J" ,)ٶ#.v2)]CK|[/ty6e-_D}i,ݔf&JC|oi -߈RÓ^tR.1t(}Gw(nUG*>\WA=v3PCg^%jaW~Ih#=w+^]3vkN%7J**Uv?m'ƙBXzP.2 -w6-Q6@6߿oz pznJ{yr;Xث@!-f2# Tn$-9W1#®XZq=Xmo6_q kǴI5fp]QE@KE5uﻣHE-mAֽ~:_0)PfLd wx%3-S~]0#hSHyyFZaB|ؔLq"2p: -dI[*XJUyVb^ ,KK=rnOgwc ]a0 J FS,f),;RTd)W!xcT!c)+QEY'mAlS|zSlSOt<38NfwSl|=w#N>o>p,$0RAQO>By(bbzYRC"ﹲȹZ -MdX -cAIu#7ϒ7X;252oR!;K>DؿmphMĴ,T"FS!6RLSZRmy/$kJ<5+ݵ > .*:RzZl=@^2WKE bnzƫd[t{/=o["5>3(q c>}vU*g^dO^Y,[hR3&Y!c/)V]*'`#n̙>BH%1GqlwRK7"G:6sdDthT?{3 pSLWI3l`{UϝnqB:lNV@,kiO}qR^6?U8xq,Bew{쳽;QmWҴ>fѣÕd{kcSoORRd7=uZhՂwxۛKm/\Ti#Ҕ.(Ug,lONjxqq1e|?grN7ژ.xtQqUG+{)㬲2"`̪Q=7HЅR:Dxm M›oPFp]/nq ]"rtCX>v#D n&n%o/g-ݨӄ-~$ $RO`ȟ.&>7 {ғ:w=x\m~AH%c@ Abp0oo;>.T|?aW-Xk0j+_[(FhzL۟=98Rҗ7fh?G9ϥsa] v/=ks8+km%dYŏ2vV&K( H IEqf߯&@J$3;[ڝ"7|:# g,-8 +/Ó,-N@k&#VfԸ7M6.QyHGQg)ݜs{g9e1HDMrg<-c7˫ ) ;6PhQ"1(!l~Ǔiɲeba>rs)`5,z-$)Ւm3Bw.4N[VzϢ{f%[@gK@͓8J[R.df,*7iYe'";Y>W$^ޜҪϻ4Ee=Ր!(A)`́餍  @z7f\ܴw}w}ݻ_ݰkvruyzѿY..Oی`(y#i#K-RNŜq<"p6>aY\h @r1KRz)++A)CʲzԔM2֤U9#e'9J2wkp64=w PC6l"#*X~8&'O H ;/p)\O$U9p-J.tDryT5?}Jw&ޱZ,z"$@UH$!@\ѕw *4K7Z$-HEp9#^f#u!qvI'a%X ʄp)s9#))3HPCA"BmJ^LR&㉚΀&(ۢcs_rRMыa6i]=$mc٢/J6 `Wlu$qr9&ۚhz˷bX;f v56-{@+vY2aHYh|z,xpljV6{PCOx##i4\A1@ԌJjZJ 5P${ h6C#OS33x;ޢ!> '6#H͸9*H\9LC/5#0VŃRO4Lbo!*w -& n- l*.0 a8sKDfS:9B;E{jGfLXa3~X84{AB{@G&9E/sƘDĴ [H' -[/,2e<*.3بsbM2bE7 PЏ p/JGhZAG$`8\D eGsV%Jmc0O:U$4 é>d{oo{W gGHfnУwjз?%Q>8aMOv󡘐y\?m_^]p#w ,`'$Bjw8xTO{o.~==;{{ώA VZogzӿ};u>nOl8&vm : ~E΁Bhp(`M@+^6BL"I>J1πKHH/No/vv*lgcZDb&&6b6M8M-2?6[q)MDβOQ.h\+,%Rm),UK7fA+WxKk( of('>r %p` L.8 -uop Oa*ŵY!!3Xwhn¯`grjt3hK %IqQb&o?W0bزfr;FyTrUpڿ -3P0$)#e殝$"x{K/n#GےMmC[%4AlcwLfG׎`ؚY&Tikt[u1ooZ"w\ޮ -bS {#|$fO0+xŭ\hZ1ԓ44PpmI[FUlGy\C xWk3^N0M NWnP?1gZ0ˬ-\="Z+U\=9.h$sry8b1 -0ZbȺVB`DK,IX - -!,f|չ)5{8,0jL9yFk8okԶDÄe׼\r=\乱cvF6,71JNޯ;}}ɑDu+Dڐn x>㠌DCb -bLLbIqGi&d4Dl>/pOg2UuA,(` 5*xL[2,˄E-m (*Q,iF - ֡{P ûN+ef)j^Ze_d^*Q&AR*w8)Vrٌ6)Y&"q*wL8'F؍8MEMxѪ Hzf`rBMyz - pzu )AEM4 㪍SڂtcTgw8 xVH:zCmG^Ln$;| s"u>Tm6cXט­W%um(!Hu375L}\CǭHeUS>՞p_ ƐeSI, 缡Lhm3UzYmG_v[5Wl _(6Ż7rXhڄBhyɑT=d^\+c3V>_{{,t1FH_V~Ted:6~(W84~&.͗!*Df员T;~G%36hQi|zKZWNE"t>^[c+Tm/C+)RC4=7, YUv|T(wCu ͹;jC֖J4dղUlW ?]SP/ -Vca̲ZVp~FKšz˫FvpfZ -tv}{U$Wn NrHHݩ!'ͦ?kDֹ#&Y [`0<#tp[GT3_%ul[BoٿA-Y>Rs5ZIx;{/C1ۆ_B/*b~ܵrU. M9,-ϬZ:|6 -xO0褻! ngfI5hz0䕳 +lK1kwS#eTO1r4F5W<5j=Rxi4+{TBj#yleehr ñ>P'\ ӭѣYE&lCqwWz:ȤۜyTѼQl-g Csh #y{=FQDp#dh V; oSG4 [R kHY{49c? ^lJ=t|c֍Jby rZ֎A_< v~BBNB"gW+aȲ0<z4s`v6Ձ3 JMJ[ ;lQj8[SǿB~zezh^Q̵T镗v/!*b!&-Hk,ѵt&E=P(YԷvtH2S}U{ԻkW [U3ve XB׿uQd-sXYYWN#nZBGjc򥪶vnqRw jY<[Lw9ޭ' M -:vּ*@wx|b ƍh%ll »'J}!E)\H-D)OT2x%}_EL~Ioj#&k-!c[&%&ٌ]}7sa~x=Z.;C2\*VXcFO.=.>:J2#;缦Tx>+7cWUO4](KcX @jI e!D> ~ڑ5դ=u_t7, xۖj}ٌ{,UxP#]%QkWr֬KqCSW`8bQ54:Ο^yMsLmEw_x6Vuj[JpnˉitV/΄ұIN)=xd1(hX1Y0_F7}dHgVw6V0!mIJxRIV|JkӪ~>c=3#AZ%n 5dcKXS"1 -n?lOgճʱk:,bEQ! |4g" e5Ğڊv[ox:!ls boI k%T鶮+oZZho/zp]np/"ѩUT/''.> -AX5ڧfaM˙N/eȵdAhw -\pXSqaג)ü*:$>pWqbJŒ;yp=ȷA!M0H)z(jvG_qmiLRQQ E$n DىZN7tc8ϗs 2tb`BDf%ch7vfMEV{PE'X|_ߍ5R[s7lGqJ""/b?TzKc,Kptэ#M˹ ==3:g5+ bGරzKѶaJ;'#2z@QFj2I$a;Kb^rpK -7\!UK2 &="- @X\m,\#7Wm$y~߹+Xʘ)ЋVo^{ -CoN - -w~5F3r'+Xfa[6lIT:%ua@Z̪ -qr'~A?n滅Z -.yQ/< I,(({ sܥvUQyDSdP0|b_%^j ᛦpNoM\)u*kQag"-"@EZzjlcVEe!%)}yr}yž߉ M-v~,y}){W1hn"y7r1AֲJYZb^Z@S^GY>9On}^@ISQ!OtC2Pi)bJ&ZdU/OUFXTu,9 -Oy[olϧ[.~-UgWj֜m'{aGy_u -Onx=n>Qn>5fGQj\V NƠ2G#(kWHQ]g~_h40)b ֞е e,UβZkBxs!,/ψwjTfw5n1iz~4n7I:`CX/^<u}L03arr|wv_jtӳlbS:';;o XpC49:xJM<% ~5Pt*&o 'A:\q,T#33fgR$a -ee##)Qp鴼^ҧnH42 -rb~̋ 6b5L%yr5|zꦜ@c$o]Dt!y` -c񗧧K kϽ<<y ycl`rŵ -bp*B1IXϟ> ˼}ͥLl^#ʡi݁~=2Khn$eӏe2A;꠸,DE\r/`QXDt]~WSy)ƱtnmaYݶt.Q8Ŧ" .L]0 -177q3X/ve)p>&󄖧ƀ*R 8秿Ɛiwrjr$טOɪG?ZdIy: ['߬?xF˼8vu~#bn5PYrOEl/IfXwی -=L5[p -Jdѓ/C5SQ)89Ō%g9LҕhI{L7UV͑hBGCmhT,0emaOt(mfG)v(T.~BtY.IQ) 8El4,ݴ(h#'*%N -Ҝ)kitZ0 LmgRP 1|V668GH-KbSov3 -p隩 - ~y%Geh{vZ Y|D !iQlyfAjAeክ̣ hZ(Z;p%ZL$s&1%@""W!︾?},fa7{SU_={@_m-V嵢(RhNTD**iZfI=Ctu1c;f<`.0R<P*/__;1BZyPsoLgYNNl`᣿Dm&!;`]?JD`\(]Mڼu>^+vQ OA&#nх[M~E)өnH5Ӝ2aUkѮך |*h>9՞ѤJﯲ=J U7od-{+G?|tޏƾ/erׇwekmmOR6NOE/d9ݜkCz\L]Y5\pmmq,Q:vxY V6j3=ncL/*5j}(]o"TZD>%),[;hmW;lt.[xh/\WP[ Ly{ nwsTwݼ[^5hil{;h_pWXmOG)IUӐj6"UB>qaܔޙ}3iE^Uݙy晗E`NA-8?Q(( - ]!sSP8?hVLp8pʔ{<:mrQI:1+IC`4 Η gct|uu<NFpq/Nx$?:24cAN R\>9 -6N2?=t/'laqk"bK -DSLtRI-}Kl5Qiw6Sz=?tg^O/BmCRLF9sojX.AzեIZa&^+L;C1jM XbQ@c1e<1 UK S;?dbfZt%X$ӵ[Ęle n˳Kh. ,1<<Ԅ/؝*"qjL>λL4z|zS -ZC/UqNWӦrNbcTE2uG79M܇. #_얃L`BqACX QK`r1VCsY%um) 4ݖ'^U"B+׌۵ c1P:j~:RRhku&e!WF|pw4;>DzzWdgg稕.3MQ}88$*)}:K^cIeVzܰUncQR10o؞86R q|؁Sij SJvҜv\gLT!8^*l:IT`\eIbnnD )lӏt?׵"K!)kl>|L @k!8'~-~xQ5^%J?rxR+dEN'dx+S*|{V+Rכ+vEIbKz6(hT#zYcѵeorF&xJ1`H^|6[J 6rkI$^U2%4i.¹XHpyxd_0dT=M ^j m//R1JWLw\u7Oɵ{mqv0נᛘMX&j,:([?qF6O8aBrS "9y voc0lmp%`urP:yZ,a4su'BE`0^kՒR$:->h Z>(I{73{ǿGQ'W?ԚǏ8<3I("LRE </l-R_,OaUP8jj){5 AJΦ+,"O͗= zH߸*Ђwx&ZUCR5`h-:j04zݪ u].'xYw|襬|5Ͳ0d{qԕvvFMbk#av8CNQ 8VvyEAYvg<1/L_¼m{n}(JpSZw}>դC /²r@*Ya.'|z)b8nbCt嶺5<mrQHnRt7ty~TI"VA#k؏%Hpt1濜7U/bLGј#U4DAwιjSr_*D5q?]}Xf]O~ÇǿtDDs_ςd)m#c;-*5.*(s+׸CouP$ERg ;t8.M9#0B[6bY}LMJ%j>կ[[~>y)G)OW^?}P~/u^.X?R~/YmsH_J-"l8VNI\%` I5߯GB L.Y>y4 o%Gq( Y^x?^2 N,7>~o[6:)R!ż d0ͳ 搧83+ #,bL[dK ua}58-E 9o_-pe9K}ۻf7 (҄xvw74;kسnߴ^@`}fb4l.1X[Jܳe.J[M' -2kik{=+m4*U!'uǎuEω;= .#Zk صZ(3[ j;c&=,<{8h"!Dc=й&/-\Gp&"]"^XX}t-z;$Fmjrh9K{l%d>; uSpnk>&f D.Wq@_gğ7Č c~9&9(UV]!V(e:n_|urt5U -WE+ =:"Gԧ,Fc휅9U -|²5TpЌ~¼N ~` KsaJ3MY {/%` q'vh# *+~KųzzF 31V;28+?a/#!%%RP -?L|3+)G$=yF6eE0čOii*ㄅã 20йśvVe:^a9LD:+qEF&6cn& 1SL(zM)\FpC]QA -`6h!@ -FbaN>]NTU: b#E S_Bj <Z64=Q4>4*N'g>OՠRh!_e,p]3Bw8TlKՎ]՜EptOtd$c'43z8NȣF:J.c2\UC ^,X 1joDyKU"Q$ &o@@wˏ[_Jf/Ǭ g -?J7|MY4q%9_u~/2J, яDN7PFiȴ04"!T7"a~$0U` *tS<`k:Le|'"tJ4@u-.<A}`p8<ROc9؜Uv֙x(h KS[4gxpJB `C]*kLVen|F; n! }hV%1/*K✪qwBAU@ť{s VMӋ?Z'G)MX]~8 s$kp-nE"qg>-o*NeyMX6i^u6^`*pnAXQrviSjtuàd͌.'۫{rŸVԨ%U_ LYh;'B78uSu+RCl n(㪏^o2tTܸx ]&soM&u x aoVWW;`Fծ[d\ccܢ lo^n{5F-onv=¸@9T=&7ϓkwLb)ͱ7t - rH?\#ԵGHmX zN|oX#kP%6 Nղ䫘15t$5u%lc}]6۪;5Oz)W9fk󴲧zz=/OW|?84#^1ӳJpxLM`! _o;S2AqgK,06[c ?x3f /M0|fD&0hkk{6 reᇜI5>wdS4oȴ%A н x&ܹNe3:Adr HG<MJze4sqY`źissk,VnG9j% E;م dtʺ+ Q9R3ooApcN-B#% ]ہ -qrD RiCY;+3_ rZьŠ&}L-@rn%4ﳃs. oya]G"*mޚ;3҉YS9)MWEITU(#(%>opj|T ~_O^&-[ob3|/_J`UkIOO,%XC\Vks9c eوַ)y3J+W+Z8;>>fH>žw䱓9{'Jj6i^ZYq<7SgQ~_\g57'˷ >~PÍnϲX8`r骢 -EEHjiԚ3T:am[&F~,V2S~u͛llͧ 70c{(S؃#X[ZD&۴ -BY?>'V>%:Em]/F;t~77o+.Bp䊷J\DIJ[Rts)nƛ|Lf czV0'HR(HAq@_Z%Ybi'ئ;Q+GPWXi}^}Xm#҂N4~sh\,= ȥxw9$.tӝ]~_ Vۅ{!(9VBYYL׍D) td)" T^yf -ykXy"UsvY<`@nY榘ܙ|qƕ~ě"JU{EѴ|\2HlEU%Fܠm'W, ̏"ܛy>j0 +3̇Ɣc'Ȥfo -I:r~0N~A5Q)HqLA<*ȁxƽ/Aj΅rEY.o$ DY}9K5bѢ1*dl<ѐH&A#<)i=|0䝨#ha:ލȧZ*IJ{v9* 隫=op]ޕ#j;FEBx,VqlC,?@Jwrsh5vˇ|tO/@x; 2N:yK3 OYTw6xPD+Ok+[F|o-Sô)~+ -HUTgJ JBҟpwTd_W^,EP0A9UD_`RvByp 4#.: -J9f~Az +]>O(!o+:ެ:S^U(2}]bcT=x?yڱXJ*78+ѩ 5nNB$'Dyht,73 SOQЊuo \ÇFl4/_[GL9pi?<8MGApPx`Xߣi2&/ g҆mh5wnHX_XǠg>6)`hČ V㨎Yw?Ոt `pq쑣F?\,U -o93(ɇYߓ fZ< KcgYxirѨ)HZL%ȋTD|MAZh@y }Rv+ȟ19`TL:*J-;"oY`+LYUQuS%ڈ6?3vӅLAՕ*AjT' PV\h+\E й:N@!&:֏J ˖Xպ4u ݌ FcqtTG H>DXw`&SPJ8!dݥD\<,}lBU#Dj ȹF{ - #ދegjzZ*{YLY0#^k;%(>Z\qH8YU=rMhi1kS -AKD:^դtE#U!7mN9DL /hJ&Š:4c_2G{t?5ρڍ( v,'D#7ǻ$52̵.kݰ8JkɼlrV΅#|eq,ary<}Z/yuUHA3 W-_ԢY%= *FO ^d\x׺ R~Z$d+CĀм^Z1Mf1cL j: 2y-(2EAt-&W_L?o_kLρTmƩWnNX-}G.PU6iR#ΣR&ŝ'=V9J͊ S('s< /Qb/d^,&e lɹ%ԙ"_՜s< .=VۢgXxZHL]'X2ږ&/+ -/w ZNʻpy'W*Q6uQ@\T(ёhZv^FaIi{M4Ѵmbd[c7(sxpI`(>5 ?6ҍEۓL:yX¶963=<{ -mC%Rl96yi{gE _&R ;ܻ](5p -B5)Em;bf񔨟)_1zWp?hGQ -7klU!lGIoYHW}Rlϯ5D#::9ƷeAt[)-T.vtQ;Iźea_Q/޳-6z9S`-"zC?I)r ?r>Ġ{W9쪜^ -)ErPkVI9_[d.O86oUCD9?hMC+Bg}׫Y%WTp+C=@`;6}yqJ\~˱-G{-(Cg]E1 -r<Jm@'"-ق%~|&VK"U{@T]O0}ϯ"TE04mo PeŚk[}iB'$Ͻğt Ih5ew-"kPEa0Ab2a_ـIg^6:2:B9Z5jQwH$8K渒X0%39Prxҵܞ_v=45t ߹79 :o$<)%D# -4um D痿tѿ!7@>qkё=c5.G'>):!ˎ.5`>jǓ'۹$֨yPǒ,er(/-GJL=HXgٓJKΑ|u})Pcq -I#^sbL'5Xn \ݢrRp{x+P{/-N АjOOj|\nöun0 y -8jM;H5RI#ABNk;X5_b%|39eqOޡ&d&{"/NJAU:Ga:>K!2,=ȇ\owl(Lv3EL@pF.|F.X-^8h <7Q#S5k=//H>] Lvo-wUXOQ@(֢~GcɀtKIg!y 2=+f  6Ơ7 sea^4-5A[!uS-|kl -~2a%~4W:LHNRE -]%2WB>{(;-23pln0Z?*8>Y>d:'{7j%I`nPNϒsF%j~ӏѨ>D)^\{bیLٳC9O(+4L0G v -jp{KFYj:(ı dLO浇KVŴMJvPI\Dq*R PM,U7gDwM;?9vǧy=q|2CD¯|CT*$4ζJDthQb. H(DmN g'Lkt1 ) ~uf0[mWvt&6b :5P|Q9N:WT*Ht%ܯ'kL9IJ"GŸOQ3&;gOU]8=>~ -9Zg}ru( xX,P+Rw[4ڸAײ]?XqUv[0T',˓k6 &ʾ۰ACukճxDacvbC,/p}V@w} t?l?Zuջ/Z]㫆aqvϱXr6}W3jI94/6θI:GXi]Q$H)RrDŽ7Y%6"ޚIS;8\]W4%%(}dPha44d )] ,z*wu*!Qi5,Bq;6̷&ugdZ5u2>ΞxUEe+͝A/lQWo|N`x?i:CQO)(@=Xjm3S%hȩOI<|amh6yf쑆pFxQGŸ@?%tawaA&Vulԯ1iDn = `!FsS)sp; M+^|.*{O o@7tM5Hu40qlEũܒ|klJe4 3n#tGx!b]+Vϲm (M- SCS`X18V(&Ul. [Oe@ 1(/moYȾՐ[v}+?*+]]Z_ڠcFZoJ=Ŷոr6Rts[b=ܼ}0c.8ISY-`Yj3ݝ68~}B^<6&'gowz@8"em GˮK舄4#Ў](>v|M%G"Z wр<9!cmgX&2 O3$Ήcj x=qa@Y (}b"[s?bWf)ϏnH= -Zh8lAR9dh@[{OH[bf! @1ݨ6ql4:l,x" -;J'0ʀg@PφNkL:D&~Ր1˖YP updEqD_\7x^jT[Td+\-fSEӉ)8Pxj@͊ @D_*Hn08ʟ+~2KQbJSYsPb,+Wul3íteB y|UR熢i.}0 X0zl3X 1T ͕0sp2CN = NY2W.g2(ػ@F7TiD W>4;M;XQD˴!0 h{I5&0@SfY,'&W$]r}:bS٥>aMZ-t2oy|&ɇЋ7GQelV"9oТʃ: -r6D{1NOu ߇1][!~?:2R_$+q- <}"K9WDsyno>qDRW\zQġ.fe3aiUB*d'oGGX7yiOr/qaQ"GIqRrƙ4\MN< loONXBG=$uf4Q9aW 21a -U=M\F{&{SvE NG,-<#O;!A?Kpg'L8b,>`<+?ZЮ*0cN1 -R7LC9?!ܖ 5ocɫW cR&;L2gHo (H~ZlR֢qޒ2:}r!h;x΁yDX[2:,bg$Z&oyobdA,uI:b9B4ѕSdP4QcvMOڇm(pxg3N) =wTZQz@xF J=;Bl>3GĜS _q]'DZ^>WGSvxyq̈O~ϯI|7Ci+p6`#vŵMYU[''\AÎe^մ,[h2 w`^i;4NFIi; ؚ楋BJ, ѐncѻoȿd ˮxl(}xwITdّ~%y7`OgK'ކzm9gc%yn+XI?~Yہ+E5n2nTm6 so 6Հ]>?o*;(pI!hI iI P dҲVj\Hw-nBgҳvUoEi T f4S:@tGA>t`?" {ld4 U7шfnXLri_x'9xc16pM7ލp;hhY` ޟ50`?qARG!7bؚuG#omްoOU\UKKkΉ*Mn(P:kKQQ8.e&=*:GUEh,U kB~5+ K2v#-5@:"?.pM!5#]6#V3ah"jg{\T-q..imabF샀 da4^j'Qւ]p_t -U١@Om{?AQol1-6d0] vflm;a0OLQ4WK{+ ->T}.Ǯ˾P)\%_8ӹjZQ-v"D> -U>:j»VN kjqI?n|< -PkTmk=Wby \c]=I8P@+l[bT3l% .t%s-F]tk< ^61ECnc ]Z`WWƺ%P^ckPߜE :V&LF^x -}~F9ja컁<É+ͨTu3Q|nHߝ -dQ+%4ٲHp<3 XȢl":5>%sΚpℇ~4P;|3q+]%prw{mke/_y$뚒/MI@,hlq˶ GY6) {hUd=:vYwqjp^LLl_:oiRr0޽]~-b02st]ZU۟RSeo>͐K\ 'ig? ~#.\#W !mz`Re.Y! w:XQ{p¯킾.qAПaCp`<](0-{JFmO|vfÍ0hWQx -Bn+:jcv펬~VeZW˰u=:X[o~ϯEZ<\v󰓝`'lH6V0xiH6~!tW_Uץۿ}x8 =Z.xcFk{}1wlC9 l=;=;bh8dKjV2S9~5Gcfdq&M^`|]rqbcǴ/{vftzN%d͑cY<{yc3nmz#ӻV." uh4ԈmxYDܝ, \w"[ޥ=p\_n[C4CZG.h?²gyy` -#LMԞX33 bWmVL3)>p%*39 3̱ϬآUlld4V>y)Kȗ*%0"v>_ϫa=TV&VlHgXʭDzh M cGLb4'_KTA;sh)ѰkГ$xqR`/L-i a?He8y}F]C%s - +8$rf2f,nJGbUjKZƮ1w"|yU <溜;v/JHɱ& -%Ꮔd(Bon6qu<ˣrO] -*;-όp7xn4~ĎwBQ_P t7FtFT!ЎjrvGLB ?TyY [M9#+~P}Ȧ]zQA%;!# M/,H:Bri_ p+t uavbh4KfG!kCOdsu'rN~xK3o&_ހ0j馺nQQ c.4zP]5ڴԷ\+qt ꩲ_fcXS:zwG; "9CnKFW`XŨZmD˯Er/injII|m u}س -X6#IwpޱlT8ꚈrAĚ*֙ўtj**ۤ9<\5Yqq.ZԤZ;J3]CS9`;fع[^,^|)5s_+>-$i+t[ cc=e=.8Lߧe飄HrX[|8nQ-ӯIǝV5Yj+J'M55|P=J,R*W՝hE+؋s_[ta7F8U%D䲻kUIHTYxg*ޯ*xKbTqkVY3 QH>ϔ݃Ʀ9'v垡հՍFgݎ2m7x{f硾1&n]ZwIohwުvշ7g'!W#= Q~9wێ$ߍK f\7>A%r>U]14yY`*(wpl"TyYM-4cW 4Z4#_2a]^OEr7P5UQo6~8yp5 -aKׅh,y"BhG,z wYuۡ/Ӄ-atsu5+E%۟~k *?Kx.M -\-OukJdQF)U Y]@k$5\MYgJeJ6WE-x3R˦z* |i$Tz..Jg\^6yW mO*Wzz ZlWVMKCt) ThqfͫK}l0@ V["Z {Y7Nop_:hgeVsуB%Ft֧;ZHRD lm$D 4J3e LW IlGآSĨmЃmf2}>m۫͘A%b8x*V$$~` `F#?^6 a@$ -p5 "ƅ7cwxF5Џ˄rql aDQ0 X41-@O{5`?O2a!kuDd3N1%%IӐ$i&˘S%!a \# F7+"Z Ed.VvzQG$zg~XI֮BEdNHa3Ա ]XBt0)i| .$x֎(}rfX,4Iҥ`qt"P!dJ0:pZǑŊŵb`5Ql#VbYQO1(": ٌF>ƭ뒯fNmnӐ[:hgm-)Yk TWyϏ'埳NJTV3q4~ N8F@}v|oFn i Qr)=m{4A8Pv8k!.jKo0%!w'wFg{(Ucx >9KޗY7͋לJª?Ax#f6wfU.eݻS#kdXZR[obנ]3_([Ys8~@Rޑd󰶕 -1dI+Rɸ`eTnD0}efD/4nmqXzn#`q1iN[lOɁW4#}sF?aoF4MM#:s8tϖgdQ$ -ᔲ/gw<Fn!,c2f;u< nY;?x^pd3EӜƻ^[DTi0e="[,ƦS~SqnH܈xYA+:wNM6 UK X;[Il1sz:n@u(6p`hb/Μb9J缂0J;wb % ) 2bJ p$= DC, hAg 1|hQ$Xb7}d= ]KN dd~9Ѡ5F]ڷG=߲mzGeÞ @Hۦaiwz9I<6mW͐t&Crl:G=>aRMAN6;>BNh8 &vMc j\b|56^Oj1!  PV?\5GFF_#(ӈ54:&0~7"}t,2;:h']X66 *x3ǨYY6m/Ay2F_͎ab[Bl]v^f}0L219 C׃>5 _t -|;2; {A1:NGwX-RT-KƗw l oeXhL iL.h>4ЍYcCKCw<'f!1ָsx?ʹ8t^wg s,dӭ^FZZU"=@D?bX]д0TľTiv"ã!phpbuF]6ʴ'?44#pI edV ؒ);ID6ffq3SԹa Ɍ:Cg'|g<A!էhpNXsn|*8r+|q$z9 8gK5YhG;3dЙCd. 4ܫes G4ZzмUQɚen~z\%ճC D:W SM^1lCҍO4!*[;\d9ſ'I..L]ʒqD+ ߿/:3]!ez5VI^#`i=z_~ɸ@C=v12$%>NB#RZA>灲ұCRp.^R߸ _Ue]I -҉8`9~jP-#ZH|x$o`jb` IgE^gxd A8 -5H1zOha{!We$"ve24ɡ%M i!T5AT"J'{d)YXWƪ|!&r|ǦeK):P/*0Xz )WYj@[ -#bmE쓆-qc +bbdgv=q8i?i}*ex &k$da 360N/*zG%RmyN*$aL/9M"!IܨA1]1q%spX09Ǹ㶫:6_ Veĕ rR@|;wՃ\3[#i1*Fk)(D?uɢ3:j8Uk^5; R%ɪ*UsQb/C5U"bSЪ"f?_uR+ ( )]`kF-_t0CKﰴ%[C6\vA1;ԆkŭͷJqPee Tk𔝶ERҤy@Rjg%I_je=q8iY;ֲQ~*$+pBzN!}͜@K&՘b4ʆu璂]EZ%F$):(|gVjэG~?xuMS\ȮdEd'beR=,dy2~T1}RDBnTt)%\$U O^#kY*x@>/YEdHv\k<0Н"oBʺ/- "`7QF6JzD9+F@qCAƟA.^$\hvV:$'щ#*pJ|rlm&ҷ`TN[E4N} +Y[eHU{xY]gWsՙj(C0=z*L :s5_"lђ?j^wYg'_G/҈|Y'-v;3y;M -Z9}LE:_w$qAU GrVƋQ\;䝭8Tm.~ '> -~m_U֊Y-db#Mu%H4+qաei>5?}:aT0<^-YxH oٌ Ç]c 9a9ia>I#q:%n&>ke|"]=xCtˬnQ" Åa\E*XI#$qDj ]GǕ@{+6M1p+.M`'ȋ[~&>ٞ+[(?Dž[5k|*X| _p^C_tMOs|/bnm˩\r5q`U! Ma\dERR+3e <JU+iqۑy8!92Rep^~yYo߄P27"Q`B-H.=l56<%Xa#U1s5 x -QL7Qe0)D36=SX4F5,+P0ܐ@4WjZF׭+qF -bݖ  R(&1:iMCe{,O ''yuWAxƚ&;;"25\´K&Un\)SnhYkfp%NwyF0$V>Q= ni'wn+'6O\f^c_,3(N[ E>9fiG8E>EAއYgEQ-k;e?T"5*bw],x?Xmo_qZʸIZ)Wd$A/d(,'k]s@.l9̙YoS7]q6iӧ>|:xFFA$\P|.8& )Rd"<"#gxGiBAR -252 [4R(Qt< i4 @/pLBd(EH,}B ǏV/QH4 #֕Ji.u;%IBk)s0qSE4&B!"I1@lDV,ʓ8"F2XPWa".a8\$JH'[ -A.(.9* -P˶&\V&nZnXc,5V4L:xHB욧u`PXGH) 1a^B?bfLdMJ)[ˇ;rt7x4:VWoWX֠Vw7m0tg۳n߰n1dޙOލ7zgʮ^,ؾNZ|ci3}z }B23nkUV';t[v*a-t8= tאַ]PT c!yH"qzdzlt#bBO߱>06FG㠃-L!],c8uߺ6ɳ[Rϵ(^ jʛI0pA , edS<0$V 5jB (6mcLh02x_΂n"xeȝV*·Zts1.94}H}܊4]& F8pѪHƷTW>#$aZ~nywG[B21%J,%O;[]$6JF*})""|hx|,}Dw+yaC#{TD,:ė|D%qEOIp[hZ:*q:R-F}j[C + CAnymk/UU7hG\]_Yg[xd8s9ՎQ,XrPʝ|#I%O%y^dEU4ecNwo/բ/s -8컨VAw)ZQ{EB,uD.j)%~)G"YuQH8He<^fE0iuQ -$^o#Ɓgr&oa,l+JnYJI 2CCZ~l:$Y-TFZ~UgyWmoH_QEk:L(Tߴi:Zl@gri+(CS*Mˆ2*.:-t]JCHY֍Cw2429Wtc ^e[zeSx ׷Fspl$8mX7 a/ͩOİ Mk mtc5G>#kFA:y3sd"ýS ˞9OcƸFCPNh7sŦ-t8cżg]xgp: -X6sbؖ5Mם|˙@-BNJkg0,ǽcLJNHTb&`:<8ے ->X׶umNG&:ĺ*-X*XI~}2>l^2pb4zPIu^7Q>4]K>I"zcWlz dA?{=VQӑTQ{pK\ɗ"DQ}s%@k#/_Bu~쳌<EMYv5 VX觧ز@DvqL`ȣ5wԯ%vO KE dC`!uہt9uZMC"YJ&q f ><\~|ߦY!0>gaTzDKe"HJ_f֔ TU\~ƓPc9Õ'4_\/YeotK\iJM)6XY~զO}"i.6YȤHN|pdbqIk%>л󓳚e,_b61\;;;J"~2*lqG:Hr+6|,>,qgDE<,iࢣv, ܐ֥A/w=]fV.SLiV^/布cl@|Y GLmy?QGXJ|]&ɡoMurE \lǨpBH/Qj{:.M/*Ƶ9, *A\pND!)q3AdBa$QEL+QNsΠj@lA=v5K rc"hā7ڬBLrn1:LADuECT|g,C>(tJ]( ƉJыI$@烆\Boyߋ]:Z^ !_kN=r)izԖ^~V]O8}W\!F-(|,>,̒&Z -I7N`*ąhҸJRXPʈCs9|: G͟~O'';U)iP$OY55}MпL~o PS%kY=h5׆2'&W%%eFZR^RU*$/Ꙧ=EC3-?GN۲6%o}xǜ\")zBV -cp5J&~pٻdj6ӷp&׈äxJk40֊2q8YVUW5.5-^sކȭT?{ǥ䱜߽bsvX`<ۦ%0},ryn[FYw&X8&b|5,/hIPmJ0s!l >.Z -Ŋ Ld;t!C9sz wSIW! .S^8#41|9pʁu4n-igi.2r]FÏ@t %؀c63ZS;:,-*y^+,yr}_hvC7ǧ!<~dwT6l|ۋ0fz8j<:[_hu9^G9Y%~mj0 y -vH`K=6= &VRS[wliÏ>IݱK xT$N5G1D -"0 z-E( p҂(%UlVar'A%^ \zAմpN|UUUYq)! .iI -;iL{6OwxØl]샛O3η]5gm垕l%fd ]Mk09P `wz(vfxXNjqy<}6g9};ɭRKK"kCs C^50`mfw.֊+yVUUU}Ɠ6*GP>K؜]V`})=Fҷ:?CVRF/f[PH<1!|5ώ,/hIp mJ0E l ~.Z -Ŋ Ld*;␇K̽aru=hJeI_ :S}G'w: -a@Ld4E(aiX~2)km*ݳ:-O3.OT%z؁ff :Ήx%8,+Ӻ.adv?=hMzkrmRmZ߉QaA -:'t&6.򇦨Y uA -@ Es\@@BQpgCh8PSo{?벆T$OBXiYP|Q~3jfK3,n>HAԀXH) q8')) { - fwrite( - STDERR, - 'This version of PHPUnit requires PHP 5.3.3; using the latest version of PHP is highly recommended.' . PHP_EOL - ); - - die(1); - } - - if (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == '--manifest') { - print file_get_contents(__PHPUNIT_PHAR_ROOT__ . '/manifest.txt'); - exit; - } - - PHPUnit_TextUI_Command::main(); -} - -__HALT_COMPILER(); diff --git a/vendor/phpunit/phpunit/build/ca.pem b/vendor/phpunit/phpunit/build/ca.pem deleted file mode 100644 index 20585f1c..00000000 --- a/vendor/phpunit/phpunit/build/ca.pem +++ /dev/null @@ -1,25 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU -MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs -IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 -MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux -FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h -bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v -dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt -H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 -uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX -mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX -a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN -E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 -WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD -VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 -Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU -cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx -IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN -AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH -YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 -6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC -Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX -c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a -mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= ------END CERTIFICATE----- diff --git a/vendor/phpunit/phpunit/build/library-phar-autoload.php.in b/vendor/phpunit/phpunit/build/library-phar-autoload.php.in deleted file mode 100644 index f919b762..00000000 --- a/vendor/phpunit/phpunit/build/library-phar-autoload.php.in +++ /dev/null @@ -1,9 +0,0 @@ -&1'); - -if (strpos($tag, '-') === false && strpos($tag, 'No names found') === false) { - print $tag; -} else { - $branch = @exec('git rev-parse --abbrev-ref HEAD'); - $hash = @exec('git log -1 --format="%H"'); - print $branch . '@' . $hash; -} - -print "\n"; - -$lock = json_decode(file_get_contents(__DIR__ . '/../composer.lock')); - -foreach ($lock->packages as $package) { - print $package->name . ': ' . $package->version; - - if (!preg_match('/^[v= ]*(([0-9]+)(\\.([0-9]+)(\\.([0-9]+)(-([0-9]+))?(-?([a-zA-Z-+][a-zA-Z0-9\\.\\-:]*)?)?)?)?)$/', $package->version)) { - print '@' . $package->source->reference; - } - - print "\n"; -} diff --git a/vendor/phpunit/phpunit/build/phar-version.php b/vendor/phpunit/phpunit/build/phar-version.php deleted file mode 100755 index 83b8746d..00000000 --- a/vendor/phpunit/phpunit/build/phar-version.php +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env php - - - - - ../tests/Fail - - - - - - - diff --git a/vendor/phpunit/phpunit/composer.json b/vendor/phpunit/phpunit/composer.json index 4a774462..b0535ded 100644 --- a/vendor/phpunit/phpunit/composer.json +++ b/vendor/phpunit/phpunit/composer.json @@ -17,15 +17,14 @@ } ], "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "irc": "irc://irc.freenode.net/phpunit" + "issues": "https://github.com/sebastianbergmann/phpunit/issues" }, "require": { "php": ">=5.3.3", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-code-coverage": "~2.1", - "phpunit/php-timer": ">=1.0.6", + "phpunit/php-timer": "^1.0.6", "phpunit/phpunit-mock-objects": "~2.3", "phpspec/prophecy": "^1.3.1", "symfony/yaml": "~2.1|~3.0", diff --git a/vendor/phpunit/phpunit/phpdox.xml.dist b/vendor/phpunit/phpunit/phpdox.xml.dist deleted file mode 100644 index b32db692..00000000 --- a/vendor/phpunit/phpunit/phpdox.xml.dist +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/phpunit/phpunit/phpunit.xml.dist b/vendor/phpunit/phpunit/phpunit.xml similarity index 100% rename from vendor/phpunit/phpunit/phpunit.xml.dist rename to vendor/phpunit/phpunit/phpunit.xml diff --git a/vendor/phpunit/phpunit/phpunit.xsd b/vendor/phpunit/phpunit/phpunit.xsd index d0d70033..7c6d04ff 100644 --- a/vendor/phpunit/phpunit/phpunit.xsd +++ b/vendor/phpunit/phpunit/phpunit.xsd @@ -1,5 +1,5 @@ - + This Schema file defines the rules by which the XML configuration file of PHPUnit 4.8 may be structured. @@ -162,17 +162,19 @@ - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php index c526c7ba..1903b1bd 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/TraversableContains.php @@ -73,7 +73,7 @@ protected function matches($other) foreach ($other as $element) { if ($this->checkForObjectIdentity && $element === $this->value) { return true; - } else if (!$this->checkForObjectIdentity && $element == $this->value) { + } elseif (!$this->checkForObjectIdentity && $element == $this->value) { return true; } } @@ -81,7 +81,7 @@ protected function matches($other) foreach ($other as $element) { if ($this->checkForNonObjectIdentity && $element === $this->value) { return true; - } else if (!$this->checkForNonObjectIdentity && $element == $this->value) { + } elseif (!$this->checkForNonObjectIdentity && $element == $this->value) { return true; } } diff --git a/vendor/phpunit/phpunit/src/Framework/TestCase.php b/vendor/phpunit/phpunit/src/Framework/TestCase.php index 0439be57..45e3736b 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestCase.php +++ b/vendor/phpunit/phpunit/src/Framework/TestCase.php @@ -1324,6 +1324,7 @@ protected function setLocale() * @param bool $callAutoload Can be used to disable __autoload() during the generation of the test double class. * @param bool $cloneArguments * @param bool $callOriginalMethods + * @param object $proxyTarget * * @return PHPUnit_Framework_MockObject_MockObject * @@ -1331,7 +1332,7 @@ protected function setLocale() * * @since Method available since Release 3.0.0 */ - public function getMock($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false, $callOriginalMethods = false) + public function getMock($originalClassName, $methods = array(), array $arguments = array(), $mockClassName = '', $callOriginalConstructor = true, $callOriginalClone = true, $callAutoload = true, $cloneArguments = false, $callOriginalMethods = false, $proxyTarget = null) { $mockObject = $this->getMockObjectGenerator()->getMock( $originalClassName, @@ -1342,7 +1343,8 @@ public function getMock($originalClassName, $methods = array(), array $arguments $callOriginalClone, $callAutoload, $cloneArguments, - $callOriginalMethods + $callOriginalMethods, + $proxyTarget ); $this->mockObjects[] = $mockObject; diff --git a/vendor/phpunit/phpunit/src/Runner/Version.php b/vendor/phpunit/phpunit/src/Runner/Version.php index d7805ab2..19b51558 100644 --- a/vendor/phpunit/phpunit/src/Runner/Version.php +++ b/vendor/phpunit/phpunit/src/Runner/Version.php @@ -30,7 +30,7 @@ public static function id() } if (self::$version === null) { - $version = new SebastianBergmann\Version('4.8.24', dirname(dirname(__DIR__))); + $version = new SebastianBergmann\Version('4.8.27', dirname(dirname(__DIR__))); self::$version = $version->getVersion(); } @@ -45,12 +45,13 @@ public static function id() public static function series() { if (strpos(self::id(), '-')) { - $tmp = explode('-', self::id()); - - return $tmp[0]; + $tmp = explode('-', self::id()); + $version = $tmp[0]; + } else { + $version = self::id(); } - return implode('.', array_slice(explode('.', self::id()), 0, 2)); + return implode('.', array_slice(explode('.', $version), 0, 2)); } /** @@ -68,12 +69,8 @@ public static function getVersionString() */ public static function getReleaseChannel() { - if (strpos(self::$pharVersion, 'alpha') !== false) { - return '-alpha'; - } - - if (strpos(self::$pharVersion, 'beta') !== false) { - return '-beta'; + if (strpos(self::$pharVersion, '-') !== false) { + return '-nightly'; } return ''; diff --git a/vendor/phpunit/phpunit/src/TextUI/TestRunner.php b/vendor/phpunit/phpunit/src/TextUI/TestRunner.php index 71648612..bb07ea7e 100644 --- a/vendor/phpunit/phpunit/src/TextUI/TestRunner.php +++ b/vendor/phpunit/phpunit/src/TextUI/TestRunner.php @@ -597,7 +597,7 @@ protected function runFailed($message) */ protected function write($buffer) { - if (PHP_SAPI != 'cli') { + if (PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg') { $buffer = htmlspecialchars($buffer); } diff --git a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl.dist b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl.dist index 8ff855c9..c1d14ddc 100644 --- a/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl.dist +++ b/vendor/phpunit/phpunit/src/Util/PHP/Template/TestCaseMethod.tpl.dist @@ -78,10 +78,19 @@ if ('' !== $configurationFilePath) { unset($configuration); } +function __phpunit_error_handler($errno, $errstr, $errfile, $errline, $errcontext) +{ + return true; +} + +set_error_handler("__phpunit_error_handler"); + {constants} {included_files} {globals} +restore_error_handler(); + if (isset($GLOBALS['__PHPUNIT_BOOTSTRAP'])) { require_once $GLOBALS['__PHPUNIT_BOOTSTRAP']; unset($GLOBALS['__PHPUNIT_BOOTSTRAP']); diff --git a/vendor/phpunit/phpunit/src/Util/Printer.php b/vendor/phpunit/phpunit/src/Util/Printer.php index 9ff7daac..d2ab41eb 100644 --- a/vendor/phpunit/phpunit/src/Util/Printer.php +++ b/vendor/phpunit/phpunit/src/Util/Printer.php @@ -127,7 +127,7 @@ public function write($buffer) $this->incrementalFlush(); } } else { - if (PHP_SAPI != 'cli') { + if (PHP_SAPI != 'cli' && PHP_SAPI != 'phpdbg') { $buffer = htmlspecialchars($buffer); } diff --git a/vendor/phpunit/phpunit/src/Util/Test.php b/vendor/phpunit/phpunit/src/Util/Test.php index cef33b37..db8d0094 100644 --- a/vendor/phpunit/phpunit/src/Util/Test.php +++ b/vendor/phpunit/phpunit/src/Util/Test.php @@ -467,12 +467,24 @@ public static function getDataFromTestWithAnnotation($docComment) $offset = strlen($matches[0][0]) + $matches[0][1]; $annotationContent = substr($docComment, $offset); $data = array(); + foreach (explode("\n", $annotationContent) as $candidateRow) { $candidateRow = trim($candidateRow); - $dataSet = json_decode($candidateRow, true); - if (json_last_error() != JSON_ERROR_NONE) { + + if ($candidateRow[0] !== '[') { break; } + + $dataSet = json_decode($candidateRow, true); + + if (json_last_error() != JSON_ERROR_NONE) { + $error = function_exists('json_last_error_msg') ? json_last_error_msg() : json_last_error(); + + throw new PHPUnit_Framework_Exception( + 'The dataset for the @testWith annotation cannot be parsed: ' . $error + ); + } + $data[] = $dataSet; } diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1149.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1149.phpt index 45e24358..c4111908 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1149.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1149.phpt @@ -15,6 +15,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .1.2 -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1216.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1216.phpt index d13403b4..631bb2a1 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1216.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1216.phpt @@ -20,6 +20,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. Starting test 'Issue1216Test::testConfigAvailableInBootstrap'. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1265.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1265.phpt index a179d5d4..1b3159c3 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1265.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1265.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1330.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1330.phpt index c31073ec..48dab3c2 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1330.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1330.phpt @@ -19,6 +19,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. Starting test 'Issue1330Test::testTrue'. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1335.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1335.phpt index cd6aade1..1ed52031 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1335.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1335.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ............ -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (12 tests, 12 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1337.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1337.phpt index 9c1d76f2..3c7077e4 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1337.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1337.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 2 assertions) \ No newline at end of file diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1348.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1348.phpt index 3cf3d516..a3a721d7 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1348.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1348.phpt @@ -25,7 +25,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. STDOUT does not break test result E -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 error: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1351.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1351.phpt index 2dbc2af7..c13c4220 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1351.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1351.phpt @@ -22,7 +22,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F.E.E -Time: %s, Memory: %sMb +Time: %s, Memory: %s There were 2 errors: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1374.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1374.phpt index 84d13be2..473e01ff 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1374.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1374.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. S -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK, but incomplete, skipped, or risky tests! Tests: 1, Assertions: 0, Skipped: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1437.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1437.phpt index f9bd41bf..b7064c58 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1437.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1437.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1468.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1468.phpt index 23c410b1..7b46ca97 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1468.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1468.phpt @@ -16,7 +16,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. I -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK, but incomplete, skipped, or risky tests! Tests: 1, Assertions: 0, Incomplete: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1471.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1471.phpt index 631d6e6d..20886823 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1471.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1471.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1472.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1472.phpt index 3e605b40..0958eb35 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1472.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1472.phpt @@ -21,6 +21,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 4 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/1570.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/1570.phpt index a94b961a..553c6448 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/1570.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/1570.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. R* -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK, but incomplete, skipped, or risky tests! Tests: 1, Assertions: 0, Risky: 1. diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/2158.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/2158.phpt new file mode 100644 index 00000000..2866ab98 --- /dev/null +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/2158.phpt @@ -0,0 +1,19 @@ +--TEST-- +#2158: Failure to run tests in separate processes if a file included into main process contains constant definition +--FILE-- + +--EXPECTF-- +PHPUnit %s by Sebastian Bergmann and contributors. + +%s + +Time: %s, Memory: %s + +OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/2158/Issue2158Test.php b/vendor/phpunit/phpunit/tests/Regression/GitHub/2158/Issue2158Test.php new file mode 100644 index 00000000..014aa4f6 --- /dev/null +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/2158/Issue2158Test.php @@ -0,0 +1,23 @@ +assertTrue(true); + } + + /** + * Constant defined previously in main process constant should be available and + * no errors should be yielded by reload of included files + * + * @runInSeparateProcess + */ + public function testSomethingElse() + { + $this->assertTrue(defined('TEST_CONSTANT')); + } +} diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/2158/constant.inc b/vendor/phpunit/phpunit/tests/Regression/GitHub/2158/constant.inc new file mode 100644 index 00000000..4137114f --- /dev/null +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/2158/constant.inc @@ -0,0 +1,5 @@ + diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/244.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/244.phpt index 3cb9aefe..b517e5c0 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/244.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/244.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. .FFF -Time: %s, Memory: %sMb +Time: %s, Memory: %s There were 3 failures: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/322.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/322.phpt index 0d892c72..0974a706 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/322.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/322.phpt @@ -21,6 +21,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. Starting test 'Issue322Test::testOne'. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 0 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/433.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/433.phpt index ead9437c..df6c6f8e 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/433.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/433.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. ..F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/445.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/445.phpt index e57e7fbf..c0183f9e 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/445.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/445.phpt @@ -16,7 +16,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. ..F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/498.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/498.phpt index 51dbe759..4f8508e1 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/498.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/498.phpt @@ -17,7 +17,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/503.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/503.phpt index 2e7b30f3..c9dbd564 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/503.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/503.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/581.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/581.phpt index c2d65459..96ad88a9 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/581.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/581.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/74.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/74.phpt index 8a4f79dc..2f54d268 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/74.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/74.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. E -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 error: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/765.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/765.phpt index dc59dd6b..637ad9d1 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/765.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/765.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. .F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/797.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/797.phpt index 4a6490f0..8be21eb6 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/797.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/797.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) \ No newline at end of file diff --git a/vendor/phpunit/phpunit/tests/Regression/GitHub/863.phpt b/vendor/phpunit/phpunit/tests/Regression/GitHub/863.phpt index 1e0ffbda..cbac4fe6 100644 --- a/vendor/phpunit/phpunit/tests/Regression/GitHub/863.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/GitHub/863.phpt @@ -19,6 +19,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ............................................................... 126 / 150 ( 84%) ........................ -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (150 tests, 150 assertions) diff --git a/vendor/phpunit/phpunit/tests/Regression/Trac/1021.phpt b/vendor/phpunit/phpunit/tests/Regression/Trac/1021.phpt index 381906cf..2bf6ca11 100644 --- a/vendor/phpunit/phpunit/tests/Regression/Trac/1021.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/Trac/1021.phpt @@ -14,6 +14,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/Trac/523.phpt b/vendor/phpunit/phpunit/tests/Regression/Trac/523.phpt index 6d5679f9..c182a987 100644 --- a/vendor/phpunit/phpunit/tests/Regression/Trac/523.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/Trac/523.phpt @@ -14,6 +14,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/Regression/Trac/578.phpt b/vendor/phpunit/phpunit/tests/Regression/Trac/578.phpt index 1b710f2d..27ea9f1f 100644 --- a/vendor/phpunit/phpunit/tests/Regression/Trac/578.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/Trac/578.phpt @@ -14,7 +14,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. EEE -Time: %s, Memory: %sMb +Time: %s, Memory: %s There were 3 errors: diff --git a/vendor/phpunit/phpunit/tests/Regression/Trac/684.phpt b/vendor/phpunit/phpunit/tests/Regression/Trac/684.phpt index 3cdb949f..da51508d 100644 --- a/vendor/phpunit/phpunit/tests/Regression/Trac/684.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/Trac/684.phpt @@ -14,7 +14,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/Regression/Trac/783.phpt b/vendor/phpunit/phpunit/tests/Regression/Trac/783.phpt index 8f405dab..73e5784d 100644 --- a/vendor/phpunit/phpunit/tests/Regression/Trac/783.phpt +++ b/vendor/phpunit/phpunit/tests/Regression/Trac/783.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 0 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/abstract-test-class.phpt b/vendor/phpunit/phpunit/tests/TextUI/abstract-test-class.phpt index 8d6c07a3..e26a80c7 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/abstract-test-class.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/abstract-test-class.phpt @@ -14,7 +14,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/TextUI/colors-always.phpt b/vendor/phpunit/phpunit/tests/TextUI/colors-always.phpt index 28b527d6..0e0ac1ed 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/colors-always.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/colors-always.phpt @@ -14,6 +14,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s %s[30;42mOK (3 tests, 3 assertions)%s[0m diff --git a/vendor/phpunit/phpunit/tests/TextUI/concrete-test-class.phpt b/vendor/phpunit/phpunit/tests/TextUI/concrete-test-class.phpt index f01bd799..445c01c4 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/concrete-test-class.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/concrete-test-class.phpt @@ -14,6 +14,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 0 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/custom-printer-debug.phpt b/vendor/phpunit/phpunit/tests/TextUI/custom-printer-debug.phpt index 19b9e059..81e4ae06 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/custom-printer-debug.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/custom-printer-debug.phpt @@ -22,6 +22,6 @@ Starting test 'BankAccountTest::testBalanceCannotBecomeNegative'. Starting test 'BankAccountTest::testBalanceCannotBecomeNegative2'. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/custom-printer-verbose.phpt b/vendor/phpunit/phpunit/tests/TextUI/custom-printer-verbose.phpt index 2e2a9909..2255a6ee 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/custom-printer-verbose.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/custom-printer-verbose.phpt @@ -19,7 +19,7 @@ Configuration: %sconfiguration.custom-printer.xml I -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 incomplete test: diff --git a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-debug.phpt b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-debug.phpt index e7e49b4e..e95136f2 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-debug.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-debug.phpt @@ -29,6 +29,6 @@ Starting test 'DataProviderDebugTest::testProvider with data set #5 (Binary Stri Starting test 'DataProviderDebugTest::testProvider with data set #6 (Binary String: 0x0009)'. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (7 tests, 7 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml-isolation.phpt index e1c4571d..0e70df80 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml-isolation.phpt @@ -34,7 +34,7 @@ Failed asserting that 2 matches expected 3. -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml.phpt b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml.phpt index a14b4664..f6ca5d16 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dataprovider-log-xml.phpt @@ -33,7 +33,7 @@ Failed asserting that 2 matches expected 3. -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/TextUI/debug.phpt b/vendor/phpunit/phpunit/tests/TextUI/debug.phpt index 1639484c..0829197c 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/debug.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/debug.phpt @@ -21,6 +21,6 @@ Starting test 'BankAccountTest::testBalanceCannotBecomeNegative'. Starting test 'BankAccountTest::testBalanceCannotBecomeNegative2'. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/default-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/default-isolation.phpt index 864484c8..cca8bc81 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/default-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/default-isolation.phpt @@ -15,6 +15,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/default.phpt b/vendor/phpunit/phpunit/tests/TextUI/default.phpt index 9fefe1a1..bd7615b2 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/default.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/default.phpt @@ -14,6 +14,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies-isolation.phpt index 226d3d83..6d2a5b35 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dependencies-isolation.phpt @@ -18,7 +18,7 @@ Runtime: %s ...FSS -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies.phpt index 593088f9..f32d10a5 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dependencies.phpt @@ -17,7 +17,7 @@ Runtime: %s ...FSS -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies2-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies2-isolation.phpt index bd88351a..5e7ef8fe 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies2-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dependencies2-isolation.phpt @@ -15,6 +15,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 5 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies2.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies2.phpt index d05b79d8..a30dd4e2 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies2.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dependencies2.phpt @@ -14,6 +14,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 5 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies3-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies3-isolation.phpt index 37d2e639..51d448c2 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies3-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dependencies3-isolation.phpt @@ -15,6 +15,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/dependencies3.phpt b/vendor/phpunit/phpunit/tests/TextUI/dependencies3.phpt index 6c5d3b1c..218620d6 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/dependencies3.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/dependencies3.phpt @@ -14,6 +14,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/empty-testcase.phpt b/vendor/phpunit/phpunit/tests/TextUI/empty-testcase.phpt index 3de7055a..0d0eccb5 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/empty-testcase.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/empty-testcase.phpt @@ -14,7 +14,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. F -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 failure: diff --git a/vendor/phpunit/phpunit/tests/TextUI/exception-stack.phpt b/vendor/phpunit/phpunit/tests/TextUI/exception-stack.phpt index db585bf0..823ef1bd 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/exception-stack.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/exception-stack.phpt @@ -14,7 +14,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. EE -Time: %s, Memory: %sMb +Time: %s, Memory: %s There were 2 errors: diff --git a/vendor/phpunit/phpunit/tests/TextUI/exclude-group-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/exclude-group-isolation.phpt index 736feda8..b9afb6b7 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/exclude-group-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/exclude-group-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/exclude-group.phpt b/vendor/phpunit/phpunit/tests/TextUI/exclude-group.phpt index f75d6115..dcbc5d3d 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/exclude-group.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/exclude-group.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/failure-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/failure-isolation.phpt index 7df4f101..a0c9906a 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/failure-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/failure-isolation.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. FFFFFFFFFFFFF -Time: %s, Memory: %sMb +Time: %s, Memory: %s There were 13 failures: diff --git a/vendor/phpunit/phpunit/tests/TextUI/failure.phpt b/vendor/phpunit/phpunit/tests/TextUI/failure.phpt index 23415e94..30ce3031 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/failure.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/failure.phpt @@ -14,7 +14,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. FFFFFFFFFFFFF -Time: %s, Memory: %sMb +Time: %s, Memory: %s There were 13 failures: diff --git a/vendor/phpunit/phpunit/tests/TextUI/fatal-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/fatal-isolation.phpt index ec7f91a9..95e3f113 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/fatal-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/fatal-isolation.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. E -Time: %s, Memory: %sMb +Time: %s, Memory: %s There was 1 error: diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-class-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-class-isolation.phpt index 31cf060d..acb2e5d7 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-class-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-class-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-class.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-class.phpt index 7b3c8dd8..97c94da1 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-class.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-class.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range-isolation.phpt index f90a6917..630a48a7 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range.phpt index 9c1e6897..2314eb85 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-classname-and-range.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number-isolation.phpt index 0d2ea778..3ff675e4 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number.phpt index 79bf6430..bc7beda4 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-number.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range-isolation.phpt index 2dfdd0c8..6aa25676 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range.phpt index c3d344cd..b3b681c4 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-range.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp-isolation.phpt index d109cfb3..db1516bb 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp.phpt index d87b3045..27db60b3 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-regexp.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string-isolation.phpt index 07c4002d..fca15519 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string.phpt index 0cf91eb7..00a32d7a 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-only-string.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range-isolation.phpt index 2231b4d1..22bacbbe 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range.phpt index 2f2aa1d7..2a6a5570 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-range.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp-isolation.phpt index 3a46c510..8126802c 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp.phpt index fdbd8bd3..17ad7183 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-regexp.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. .. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (2 tests, 2 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string-isolation.phpt index d91ca73f..db34b62b 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string.phpt index eb3e6afd..79878e9b 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-dataprovider-by-string.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-insensitive.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-insensitive.phpt index 55519a1c..4f510421 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-insensitive.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-insensitive.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-sensitive-no-result.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-sensitive-no-result.phpt index 0551054d..454d116d 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-sensitive-no-result.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-method-case-sensitive-no-result.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. -Time: %s, Memory: %sMb +Time: %s, Memory: %s No tests executed! diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-method-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-method-isolation.phpt index 9cd16eff..c9fa6e54 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-method-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-method-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-method.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-method.phpt index 9f5b01cb..95fd598a 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-method.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-method.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/filter-no-results.phpt b/vendor/phpunit/phpunit/tests/TextUI/filter-no-results.phpt index a2720c86..bb1e6d37 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/filter-no-results.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/filter-no-results.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. -Time: %s, Memory: %sMb +Time: %s, Memory: %s No tests executed! diff --git a/vendor/phpunit/phpunit/tests/TextUI/group-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/group-isolation.phpt index 9fc0d02d..7e74c6f9 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/group-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/group-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/group.phpt b/vendor/phpunit/phpunit/tests/TextUI/group.phpt index 858456bd..be123934 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/group.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/group.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/ini-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/ini-isolation.phpt index ee002df5..76b88ac1 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/ini-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/ini-isolation.phpt @@ -17,6 +17,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-json-no-pretty-print.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-json-no-pretty-print.phpt index b2b4ae87..33ed4ed4 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/log-json-no-pretty-print.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/log-json-no-pretty-print.phpt @@ -22,6 +22,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. {"event":"suiteStart","suite":"BankAccountTest","tests":3}{"event":"testStart","suite":"BankAccountTest","test":"BankAccountTest::testBalanceIsInitiallyZero"}.{"event":"test","suite":"BankAccountTest","test":"BankAccountTest::testBalanceIsInitiallyZero","status":"pass","time":%f,"trace":[],"message":"","output":""}{"event":"testStart","suite":"BankAccountTest","test":"BankAccountTest::testBalanceCannotBecomeNegative"}.{"event":"test","suite":"BankAccountTest","test":"BankAccountTest::testBalanceCannotBecomeNegative","status":"pass","time":%f,"trace":[],"message":"","output":""}{"event":"testStart","suite":"BankAccountTest","test":"BankAccountTest::testBalanceCannotBecomeNegative2"}.{"event":"test","suite":"BankAccountTest","test":"BankAccountTest::testBalanceCannotBecomeNegative2","status":"pass","time":%f,"trace":[],"message":"","output":""} -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-json-post-66021.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-json-post-66021.phpt index deb03a43..b045617c 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/log-json-post-66021.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/log-json-post-66021.phpt @@ -67,6 +67,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. "output": "" } -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-json-pre-66021.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-json-pre-66021.phpt index a2fb751b..1b2b37c0 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/log-json-pre-66021.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/log-json-pre-66021.phpt @@ -73,6 +73,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. "output": "" } -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-tap.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-tap.phpt index 6e13626b..e9221ee4 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/log-tap.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/log-tap.phpt @@ -21,6 +21,6 @@ TAP version 13 1..3 -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/log-xml.phpt b/vendor/phpunit/phpunit/tests/TextUI/log-xml.phpt index a031c85b..a1c65709 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/log-xml.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/log-xml.phpt @@ -24,6 +24,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/options-after-arguments.phpt b/vendor/phpunit/phpunit/tests/TextUI/options-after-arguments.phpt index d4cdc1af..e7f2cec8 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/options-after-arguments.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/options-after-arguments.phpt @@ -14,6 +14,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s %s[30;42mOK (3 tests, 3 assertions)%s[0m diff --git a/vendor/phpunit/phpunit/tests/TextUI/output-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/output-isolation.phpt index 128a7e26..5226b257 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/output-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/output-isolation.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. . -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (1 test, 1 assertion) diff --git a/vendor/phpunit/phpunit/tests/TextUI/repeat.phpt b/vendor/phpunit/phpunit/tests/TextUI/repeat.phpt index db5eddb2..8be67ea4 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/repeat.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/repeat.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ......... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (9 tests, 9 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-incomplete.phpt b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-incomplete.phpt index 9bc4c2dc..04239246 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-incomplete.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-incomplete.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. I -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK, but incomplete, skipped, or risky tests! Tests: 1, Assertions: 0, Incomplete: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-isolation.phpt b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-isolation.phpt index 9401b269..ff6a0d1e 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-isolation.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests-isolation.phpt @@ -16,7 +16,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. R -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK, but incomplete, skipped, or risky tests! Tests: 1, Assertions: 0, Risky: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests.phpt b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests.phpt index 9eb22dfc..f9812782 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/report-useless-tests.phpt @@ -15,7 +15,7 @@ PHPUnit %s by Sebastian Bergmann and contributors. R -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK, but incomplete, skipped, or risky tests! Tests: 1, Assertions: 0, Risky: 1. diff --git a/vendor/phpunit/phpunit/tests/TextUI/test-suffix-multiple.phpt b/vendor/phpunit/phpunit/tests/TextUI/test-suffix-multiple.phpt index 417f0658..6509b68f 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/test-suffix-multiple.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/test-suffix-multiple.phpt @@ -15,6 +15,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ..... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (5 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/test-suffix-single.phpt b/vendor/phpunit/phpunit/tests/TextUI/test-suffix-single.phpt index 6c359371..137a3e51 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/test-suffix-single.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/test-suffix-single.phpt @@ -15,6 +15,6 @@ PHPUnit %s by Sebastian Bergmann and contributors. ... -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/testdox-html.phpt b/vendor/phpunit/phpunit/tests/TextUI/testdox-html.phpt index 95e44057..c5ebeef2 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/testdox-html.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/testdox-html.phpt @@ -16,6 +16,6 @@ PHPUnit %s by Sebastian Bergmann and contributors.

    BankAccount

      ...
    • Balance is initially zero
    • Balance cannot become negative
    -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/TextUI/testdox-text.phpt b/vendor/phpunit/phpunit/tests/TextUI/testdox-text.phpt index 79c67553..bb36acfb 100644 --- a/vendor/phpunit/phpunit/tests/TextUI/testdox-text.phpt +++ b/vendor/phpunit/phpunit/tests/TextUI/testdox-text.phpt @@ -20,6 +20,6 @@ BankAccount -Time: %s, Memory: %sMb +Time: %s, Memory: %s OK (3 tests, 3 assertions) diff --git a/vendor/phpunit/phpunit/tests/Util/TestTest.php b/vendor/phpunit/phpunit/tests/Util/TestTest.php index 2ec3829b..2b425364 100644 --- a/vendor/phpunit/phpunit/tests/Util/TestTest.php +++ b/vendor/phpunit/phpunit/tests/Util/TestTest.php @@ -346,13 +346,25 @@ public function testTestWithThrowsProperExceptionIfDatasetCannotBeParsed() { $this->setExpectedExceptionRegExp( 'PHPUnit_Framework_Exception', - '/^The dataset for the @testWith annotation cannot be parsed.$/' + '/^The dataset for the @testWith annotation cannot be parsed:/' ); PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** * @testWith [s] */'); } + public function testTestWithThrowsProperExceptionIfMultiLineDatasetCannotBeParsed() + { + $this->setExpectedExceptionRegExp( + 'PHPUnit_Framework_Exception', + '/^The dataset for the @testWith annotation cannot be parsed:/' + ); + PHPUnit_Util_Test::getDataFromTestWithAnnotation('/** + * @testWith ["valid"] + * [invalid] + */'); + } + /** * @covers PHPUnit_Util_Test::getDependencies * diff --git a/vendor/react/promise/.gitignore b/vendor/react/promise/.gitignore index c4bcb78f..5241c60a 100644 --- a/vendor/react/promise/.gitignore +++ b/vendor/react/promise/.gitignore @@ -1,4 +1,5 @@ composer.lock composer.phar phpunit.xml +build/ vendor/ diff --git a/vendor/react/promise/.travis.yml b/vendor/react/promise/.travis.yml index 7e7f351f..19c08ab1 100644 --- a/vendor/react/promise/.travis.yml +++ b/vendor/react/promise/.travis.yml @@ -5,13 +5,18 @@ php: - 5.5 - 5.6 - 7.0 + - nightly - hhvm before_install: - composer self-update install: - - composer install --prefer-source + - composer install script: - - phpunit -v --coverage-text + - phpunit -v --coverage-text --coverage-clover=./build/logs/clover.xml + +after_script: + - if [ -f ./build/logs/clover.xml ]; then travis_retry composer require satooshi/php-coveralls --no-interaction --update-with-dependencies; fi + - if [ -f ./build/logs/clover.xml ]; then php vendor/bin/coveralls -v; fi diff --git a/vendor/react/promise/CHANGELOG.md b/vendor/react/promise/CHANGELOG.md index 28d279c0..4b1d59d0 100644 --- a/vendor/react/promise/CHANGELOG.md +++ b/vendor/react/promise/CHANGELOG.md @@ -1,69 +1,93 @@ CHANGELOG ========= +* 2.4.1 (2016-05-03) + + * Fix `some()` not cancelling pending promises when too much input promises + reject (16ff799). + +* 2.4.0 (2016-03-31) + + * Support foreign thenables in `resolve()`. + Any object that provides a `then()` method is now assimilated to a trusted + promise that follows the state of this thenable (#52). + * Fix `some()` and `any()` for input arrays containing not enough items + (#34). + +* 2.3.0 (2016-03-24) + + * Allow cancellation of promises returned by functions working on promise + collections (#36). + * Handle `\Throwable` in the same way as `\Exception` (#51 by @joshdifabio). + * 2.2.2 (2016-02-26) - * Fix cancellation handlers called multiple times (#47 by @clue). + * Fix cancellation handlers called multiple times (#47 by @clue). * 2.2.1 (2015-07-03) - * Fix stack error when resolving a promise in its own fulfillment or rejection - handlers. + * Fix stack error when resolving a promise in its own fulfillment or + rejection handlers. * 2.2.0 (2014-12-30) - * Introduce new ExtendedPromiseInterface implemented by all promises - * Add new .done() method (part of the ExtendedPromiseInterface) - * Add new .otherwise() method (part of the ExtendedPromiseInterface) - * Add new .always() method (part of the ExtendedPromiseInterface) - * Add new .progress() method (part of the ExtendedPromiseInterface) - * Rename Deferred::progress to Deferred::notify to avoid confusion with - ExtendedPromiseInterface::progress (a Deferred::progress alias is still - available for backward compatibility) - * resolve() now always returns a ExtendedPromiseInterface + * Introduce new `ExtendedPromiseInterface` implemented by all promises. + * Add new `done()` method (part of the `ExtendedPromiseInterface`). + * Add new `otherwise()` method (part of the `ExtendedPromiseInterface`). + * Add new `always()` method (part of the `ExtendedPromiseInterface`). + * Add new `progress()` method (part of the `ExtendedPromiseInterface`). + * Rename `Deferred::progress` to `Deferred::notify` to avoid confusion with + `ExtendedPromiseInterface::progress` (a `Deferred::progress` alias is + still available for backward compatibility) + * `resolve()` now always returns a `ExtendedPromiseInterface`. * 2.1.0 (2014-10-15) - * Introduce new CancellablePromiseInterface implemented by all promises - * Add new .cancel() method (part of the CancellablePromiseInterface) + * Introduce new `CancellablePromiseInterface` implemented by all promises. + * Add new `cancel()` method (part of the `CancellablePromiseInterface`). * 2.0.0 (2013-12-10) - New major release. The goal was to streamline the API and to make it more - compliant with other promise libraries and especially with the new upcoming - [ES6 promises specification](https://github.com/domenic/promises-unwrapping/). - - * Add standalone Promise class. - * Add new React\Promise\race() function. - * BC break: Bump minimum PHP version to PHP 5.4. - * BC break: Remove ResolverInterface and PromiseInterface from Deferred. - * BC break: Change signature of PromiseInterface. - * BC break: Remove When and Util classes and move static methods to functions. - * BC break: FulfilledPromise and RejectedPromise now throw an exception when - initialized with a promise instead of a value/reason. - * BC break: React\Promise\Deferred::resolve() and React\Promise\Deferred::reject() - no longer return a promise. + New major release. The goal is to streamline the API and to make it more + compliant with other promise libraries and especially with the new upcoming + [ES6 promises specification](https://github.com/domenic/promises-unwrapping/). + + * Add standalone Promise class. + * Add new `race()` function. + * BC break: Bump minimum PHP version to PHP 5.4. + * BC break: Remove `ResolverInterface` and `PromiseInterface` from + `Deferred`. + * BC break: Change signature of `PromiseInterface`. + * BC break: Remove `When` and `Util` classes and move static methods to + functions. + * BC break: `FulfilledPromise` and `RejectedPromise` now throw an exception + when initialized with a promise instead of a value/reason. + * BC break: `Deferred::resolve()` and `Deferred::reject()` no longer return + a promise. * 1.0.4 (2013-04-03) - * Trigger PHP errors when invalid callback is passed. - * Fully resolve rejection value before calling rejection handler. - * Add When::lazy() to create lazy promises which will be initialized once a - consumer calls the then() method. + * Trigger PHP errors when invalid callback is passed. + * Fully resolve rejection value before calling rejection handler. + * Add `When::lazy()` to create lazy promises which will be initialized once + a consumer calls the `then()` method. * 1.0.3 (2012-11-17) - * Add `PromisorInterface` for objects that have a `promise()` method. + * Add `PromisorInterface` for objects that have a `promise()` method. * 1.0.2 (2012-11-14) - * Fix bug in When::any() not correctly unwrapping to a single result value - * $promiseOrValue argument of When::resolve() and When::reject() is now optional + * Fix bug in `When::any()` not correctly unwrapping to a single result + value. + * `$promiseOrValue` argument of `When::resolve()` and When::reject() is now + optional. * 1.0.1 (2012-11-13) - * Prevent deep recursion which was reaching `xdebug.max_nesting_level` default of 100 + * Prevent deep recursion which was reaching `xdebug.max_nesting_level` + default of 100. * 1.0.0 (2012-11-07) - * First tagged release + * First tagged release. diff --git a/vendor/react/promise/README.md b/vendor/react/promise/README.md index d177e047..9c0558c0 100644 --- a/vendor/react/promise/README.md +++ b/vendor/react/promise/README.md @@ -5,6 +5,7 @@ A lightweight implementation of [CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP. [![Build Status](https://travis-ci.org/reactphp/promise.svg?branch=master)](http://travis-ci.org/reactphp/promise) +[![Coverage Status](https://coveralls.io/repos/github/reactphp/promise/badge.svg?branch=master)](https://coveralls.io/github/reactphp/promise?branch=master) Table of Contents ----------------- @@ -446,6 +447,11 @@ $promise->then(function ($value) { Useful functions for creating, joining, mapping and reducing collections of promises. +All functions working on promise collections (like `all()`, `race()`, `some()` +etc.) support cancellation. This means, if you call `cancel()` on the returned +promise, all promises in the collection are cancelled. If the collection itself +is a promise which resolves to an array, this promise is also cancelled. + #### resolve() ```php @@ -457,7 +463,10 @@ Creates a promise for the supplied `$promiseOrValue`. If `$promiseOrValue` is a value, it will be the resolution value of the returned promise. -If `$promiseOrValue` is a promise, it will simply be returned. +If `$promiseOrValue` is a thenable (any object that provides a `then()` method), +a trusted promise that follows the state of the thenable is returned. + +If `$promiseOrValue` is a promise, it will be returned as is. Note: The promise returned is always a promise implementing [ExtendedPromiseInterface](#extendedpromiseinterface). If you pass in a custom @@ -515,6 +524,9 @@ will be the resolution value of the triggering item. The returned promise will only reject if *all* items in `$promisesOrValues` are rejected. The rejection value will be an array of all rejection reasons. +The returned promise will also reject with a `React\Promise\Exception\LengthException` +if `$promisesOrValues` contains 0 items. + #### some() ```php @@ -531,6 +543,9 @@ to resolve (that is, when `(count($promisesOrValues) - $howMany) + 1` items reject). The rejection value will be an array of `(count($promisesOrValues) - $howMany) + 1` rejection reasons. +The returned promise will also reject with a `React\Promise\Exception\LengthException` +if `$promisesOrValues` contains less items than `$howMany`. + #### map() ```php @@ -660,16 +675,18 @@ $deferred->promise() ->then(function ($x) { throw new \Exception($x + 1); }) - ->then(null, function (\Exception $x) { + ->otherwise(function (\Exception $x) { // Propagate the rejection throw $x; }) - ->then(null, function (\Exception $x) { + ->otherwise(function (\Exception $x) { // Can also propagate by returning another rejection - return React\Promise\reject((integer) $x->getMessage() + 1); + return React\Promise\reject( + new \Exception($x->getMessage() + 1) + ); }) - ->then(null, function ($x) { - echo 'Reject ' . $x; // 3 + ->otherwise(function ($x) { + echo 'Reject ' . $x->getMessage(); // 3 }); $deferred->resolve(1); // Prints "Reject 3" @@ -688,12 +705,12 @@ $deferred->promise() return $x + 1; }) ->then(function ($x) { - throw \Exception($x + 1); + throw new \Exception($x + 1); }) - ->then(null, function (\Exception $x) { + ->otherwise(function (\Exception $x) { // Handle the rejection, and don't propagate. // This is like catch without a rethrow - return (integer) $x->getMessage() + 1; + return $x->getMessage() + 1; }) ->then(function ($x) { echo 'Mixed ' . $x; // 4 diff --git a/vendor/react/promise/composer.json b/vendor/react/promise/composer.json index b90b7c30..22dae5a2 100644 --- a/vendor/react/promise/composer.json +++ b/vendor/react/promise/composer.json @@ -14,6 +14,11 @@ }, "files": ["src/functions_include.php"] }, + "autoload-dev": { + "psr-4": { + "React\\Promise\\": "tests/fixtures" + } + }, "extra": { "branch-alias": { "dev-master": "2.0-dev" diff --git a/vendor/react/promise/phpunit.xml.dist b/vendor/react/promise/phpunit.xml.dist index 0200d463..b9a689d7 100644 --- a/vendor/react/promise/phpunit.xml.dist +++ b/vendor/react/promise/phpunit.xml.dist @@ -20,6 +20,9 @@ ./src/ + + ./src/functions_include.php +
    diff --git a/vendor/react/promise/src/CancellationQueue.php b/vendor/react/promise/src/CancellationQueue.php new file mode 100644 index 00000000..a366994d --- /dev/null +++ b/vendor/react/promise/src/CancellationQueue.php @@ -0,0 +1,55 @@ +started) { + return; + } + + $this->started = true; + $this->drain(); + } + + public function enqueue($cancellable) + { + if (!method_exists($cancellable, 'then') || !method_exists($cancellable, 'cancel')) { + return; + } + + $length = array_push($this->queue, $cancellable); + + if ($this->started && 1 === $length) { + $this->drain(); + } + } + + private function drain() + { + for ($i = key($this->queue); isset($this->queue[$i]); $i++) { + $cancellable = $this->queue[$i]; + + $exception = null; + + try { + $cancellable->cancel(); + } catch (\Throwable $exception) { + } catch (\Exception $exception) { + } + + unset($this->queue[$i]); + + if ($exception) { + throw $exception; + } + } + + $this->queue = []; + } +} diff --git a/vendor/react/promise/src/Exception/LengthException.php b/vendor/react/promise/src/Exception/LengthException.php new file mode 100644 index 00000000..775c48db --- /dev/null +++ b/vendor/react/promise/src/Exception/LengthException.php @@ -0,0 +1,7 @@ +value)); + } catch (\Throwable $exception) { + return new RejectedPromise($exception); } catch (\Exception $exception) { return new RejectedPromise($exception); } diff --git a/vendor/react/promise/src/LazyPromise.php b/vendor/react/promise/src/LazyPromise.php index 919da457..d72619e1 100644 --- a/vendor/react/promise/src/LazyPromise.php +++ b/vendor/react/promise/src/LazyPromise.php @@ -47,6 +47,8 @@ private function promise() if (null === $this->promise) { try { $this->promise = resolve(call_user_func($this->factory)); + } catch (\Throwable $exception) { + $this->promise = new RejectedPromise($exception); } catch (\Exception $exception) { $this->promise = new RejectedPromise($exception); } diff --git a/vendor/react/promise/src/Promise.php b/vendor/react/promise/src/Promise.php index 7af99435..bfbdc06d 100644 --- a/vendor/react/promise/src/Promise.php +++ b/vendor/react/promise/src/Promise.php @@ -104,6 +104,8 @@ private function resolver(callable $onFulfilled = null, callable $onRejected = n $progressHandler = function ($update) use ($notify, $onProgress) { try { $notify($onProgress($update)); + } catch (\Throwable $e) { + $notify($e); } catch (\Exception $e) { $notify($e); } @@ -186,6 +188,8 @@ function ($update = null) { $this->notify($update); } ); + } catch (\Throwable $e) { + $this->reject($e); } catch (\Exception $e) { $this->reject($e); } diff --git a/vendor/react/promise/src/RejectedPromise.php b/vendor/react/promise/src/RejectedPromise.php index fcb9063a..479a746b 100644 --- a/vendor/react/promise/src/RejectedPromise.php +++ b/vendor/react/promise/src/RejectedPromise.php @@ -23,6 +23,8 @@ public function then(callable $onFulfilled = null, callable $onRejected = null, try { return resolve($onRejected($this->reason)); + } catch (\Throwable $exception) { + return new RejectedPromise($exception); } catch (\Exception $exception) { return new RejectedPromise($exception); } diff --git a/vendor/react/promise/src/UnhandledRejectionException.php b/vendor/react/promise/src/UnhandledRejectionException.php index ed166b30..a44b7a1b 100644 --- a/vendor/react/promise/src/UnhandledRejectionException.php +++ b/vendor/react/promise/src/UnhandledRejectionException.php @@ -8,7 +8,7 @@ class UnhandledRejectionException extends \RuntimeException public static function resolve($reason) { - if ($reason instanceof \Exception) { + if ($reason instanceof \Exception || $reason instanceof \Throwable) { return $reason; } diff --git a/vendor/react/promise/src/functions.php b/vendor/react/promise/src/functions.php index 9b361dd9..5f55f2ea 100644 --- a/vendor/react/promise/src/functions.php +++ b/vendor/react/promise/src/functions.php @@ -4,17 +4,23 @@ function resolve($promiseOrValue = null) { - if (!$promiseOrValue instanceof PromiseInterface) { - return new FulfilledPromise($promiseOrValue); - } - if ($promiseOrValue instanceof ExtendedPromiseInterface) { return $promiseOrValue; } - return new Promise(function ($resolve, $reject, $notify) use ($promiseOrValue) { - $promiseOrValue->then($resolve, $reject, $notify); - }); + if (method_exists($promiseOrValue, 'then')) { + $canceller = null; + + if (method_exists($promiseOrValue, 'cancel')) { + $canceller = [$promiseOrValue, 'cancel']; + } + + return new Promise(function ($resolve, $reject, $notify) use ($promiseOrValue) { + $promiseOrValue->then($resolve, $reject, $notify); + }, $canceller); + } + + return new FulfilledPromise($promiseOrValue); } function reject($promiseOrValue = null) @@ -37,19 +43,35 @@ function all($promisesOrValues) function race($promisesOrValues) { - return resolve($promisesOrValues) - ->then(function ($array) { - if (!is_array($array) || !$array) { - return resolve(); - } + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($promisesOrValues); + + return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $cancellationQueue) { + resolve($promisesOrValues) + ->done(function ($array) use ($cancellationQueue, $resolve, $reject, $notify) { + if (!is_array($array) || !$array) { + $resolve(); + return; + } + + $fulfiller = function ($value) use ($cancellationQueue, $resolve) { + $cancellationQueue(); + $resolve($value); + }; + + $rejecter = function ($reason) use ($cancellationQueue, $reject) { + $cancellationQueue(); + $reject($reason); + }; - return new Promise(function ($resolve, $reject, $notify) use ($array) { foreach ($array as $promiseOrValue) { + $cancellationQueue->enqueue($promiseOrValue); + resolve($promiseOrValue) - ->done($resolve, $reject, $notify); + ->done($fulfiller, $rejecter, $notify); } - }); - }); + }, $reject, $notify); + }, $cancellationQueue); } function any($promisesOrValues) @@ -62,21 +84,38 @@ function any($promisesOrValues) function some($promisesOrValues, $howMany) { - return resolve($promisesOrValues) - ->then(function ($array) use ($howMany) { - if (!is_array($array) || !$array || $howMany < 1) { - return resolve([]); - } - - return new Promise(function ($resolve, $reject, $notify) use ($array, $howMany) { - $len = count($array); - $toResolve = min($howMany, $len); + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($promisesOrValues); + + return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $howMany, $cancellationQueue) { + resolve($promisesOrValues) + ->done(function ($array) use ($howMany, $cancellationQueue, $resolve, $reject, $notify) { + if (!is_array($array) || $howMany < 1) { + $resolve([]); + return; + } + + $len = count($array); + + if ($len < $howMany) { + throw new Exception\LengthException( + sprintf( + 'Input array must contain at least %d item%s but contains only %s item%s.', + $howMany, + 1 === $howMany ? '' : 's', + $len, + 1 === $len ? '' : 's' + ) + ); + } + + $toResolve = $howMany; $toReject = ($len - $toResolve) + 1; $values = []; $reasons = []; foreach ($array as $i => $promiseOrValue) { - $fulfiller = function ($val) use ($i, &$values, &$toResolve, $toReject, $resolve) { + $fulfiller = function ($val) use ($i, &$values, &$toResolve, $toReject, $resolve, $cancellationQueue) { if ($toResolve < 1 || $toReject < 1) { return; } @@ -84,11 +123,12 @@ function some($promisesOrValues, $howMany) $values[$i] = $val; if (0 === --$toResolve) { + $cancellationQueue(); $resolve($values); } }; - $rejecter = function ($reason) use ($i, &$reasons, &$toReject, $toResolve, $reject) { + $rejecter = function ($reason) use ($i, &$reasons, &$toReject, $toResolve, $reject, $cancellationQueue) { if ($toResolve < 1 || $toReject < 1) { return; } @@ -96,30 +136,39 @@ function some($promisesOrValues, $howMany) $reasons[$i] = $reason; if (0 === --$toReject) { + $cancellationQueue(); $reject($reasons); } }; + $cancellationQueue->enqueue($promiseOrValue); + resolve($promiseOrValue) ->done($fulfiller, $rejecter, $notify); } - }); - }); + }, $reject, $notify); + }, $cancellationQueue); } function map($promisesOrValues, callable $mapFunc) { - return resolve($promisesOrValues) - ->then(function ($array) use ($mapFunc) { - if (!is_array($array) || !$array) { - return resolve([]); - } + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($promisesOrValues); + + return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $mapFunc, $cancellationQueue) { + resolve($promisesOrValues) + ->done(function ($array) use ($mapFunc, $cancellationQueue, $resolve, $reject, $notify) { + if (!is_array($array) || !$array) { + $resolve([]); + return; + } - return new Promise(function ($resolve, $reject, $notify) use ($array, $mapFunc) { $toResolve = count($array); $values = []; foreach ($array as $i => $promiseOrValue) { + $cancellationQueue->enqueue($promiseOrValue); + resolve($promiseOrValue) ->then($mapFunc) ->done( @@ -134,35 +183,45 @@ function ($mapped) use ($i, &$values, &$toResolve, $resolve) { $notify ); } - }); - }); + }, $reject, $notify); + }, $cancellationQueue); } function reduce($promisesOrValues, callable $reduceFunc, $initialValue = null) { - return resolve($promisesOrValues) - ->then(function ($array) use ($reduceFunc, $initialValue) { - if (!is_array($array)) { - $array = []; - } - - $total = count($array); - $i = 0; - - // Wrap the supplied $reduceFunc with one that handles promises and then - // delegates to the supplied. - $wrappedReduceFunc = function ($current, $val) use ($reduceFunc, $total, &$i) { - return resolve($current) - ->then(function ($c) use ($reduceFunc, $total, &$i, $val) { - return resolve($val) - ->then(function ($value) use ($reduceFunc, $total, &$i, $c) { - return $reduceFunc($c, $value, $i++, $total); - }); - }); - }; - - return array_reduce($array, $wrappedReduceFunc, $initialValue); - }); + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($promisesOrValues); + + return new Promise(function ($resolve, $reject, $notify) use ($promisesOrValues, $reduceFunc, $initialValue, $cancellationQueue) { + resolve($promisesOrValues) + ->done(function ($array) use ($reduceFunc, $initialValue, $cancellationQueue, $resolve, $reject, $notify) { + if (!is_array($array)) { + $array = []; + } + + $total = count($array); + $i = 0; + + // Wrap the supplied $reduceFunc with one that handles promises and then + // delegates to the supplied. + $wrappedReduceFunc = function ($current, $val) use ($reduceFunc, $cancellationQueue, $total, &$i) { + $cancellationQueue->enqueue($val); + + return $current + ->then(function ($c) use ($reduceFunc, $total, &$i, $val) { + return resolve($val) + ->then(function ($value) use ($reduceFunc, $total, &$i, $c) { + return $reduceFunc($c, $value, $i++, $total); + }); + }); + }; + + $cancellationQueue->enqueue($initialValue); + + array_reduce($array, $wrappedReduceFunc, resolve($initialValue)) + ->done($resolve, $reject, $notify); + }, $reject, $notify); + }, $cancellationQueue); } // Internal functions diff --git a/vendor/react/promise/tests/CancellationQueueTest.php b/vendor/react/promise/tests/CancellationQueueTest.php new file mode 100644 index 00000000..cf67b7b0 --- /dev/null +++ b/vendor/react/promise/tests/CancellationQueueTest.php @@ -0,0 +1,98 @@ +enqueue($p); + + $cancellationQueue(); + + $this->assertTrue($p->cancelCalled); + } + + /** @test */ + public function ignoresSimpleCancellable() + { + $p = new SimpleTestCancellable(); + + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($p); + + $cancellationQueue(); + + $this->assertFalse($p->cancelCalled); + } + + /** @test */ + public function callsCancelOnPromisesEnqueuedBeforeStart() + { + $d1 = $this->getCancellableDeferred(); + $d2 = $this->getCancellableDeferred(); + + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($d1->promise()); + $cancellationQueue->enqueue($d2->promise()); + + $cancellationQueue(); + } + + /** @test */ + public function callsCancelOnPromisesEnqueuedAfterStart() + { + $d1 = $this->getCancellableDeferred(); + $d2 = $this->getCancellableDeferred(); + + $cancellationQueue = new CancellationQueue(); + + $cancellationQueue(); + + $cancellationQueue->enqueue($d2->promise()); + $cancellationQueue->enqueue($d1->promise()); + } + + /** @test */ + public function doesNotCallCancelTwiceWhenStartedTwice() + { + $d = $this->getCancellableDeferred(); + + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($d->promise()); + + $cancellationQueue(); + $cancellationQueue(); + } + + /** @test */ + public function rethrowsExceptionsThrownFromCancel() + { + $this->setExpectedException('\Exception', 'test'); + + $mock = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock + ->expects($this->once()) + ->method('cancel') + ->will($this->throwException(new \Exception('test'))); + + $cancellationQueue = new CancellationQueue(); + $cancellationQueue->enqueue($mock); + + $cancellationQueue(); + } + + private function getCancellableDeferred() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke'); + + return new Deferred($mock); + } +} diff --git a/vendor/react/promise/tests/FunctionAnyTest.php b/vendor/react/promise/tests/FunctionAnyTest.php index bf8a0db4..6c40674b 100644 --- a/vendor/react/promise/tests/FunctionAnyTest.php +++ b/vendor/react/promise/tests/FunctionAnyTest.php @@ -2,18 +2,38 @@ namespace React\Promise; +use React\Promise\Exception\LengthException; + class FunctionAnyTest extends TestCase { /** @test */ - public function shouldResolveToNullWithEmptyInputArray() + public function shouldRejectWithLengthExceptionWithEmptyInputArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo(null)); + ->with( + $this->callback(function($exception){ + return $exception instanceof LengthException && + 'Input array must contain at least 1 item but contains only 0 items.' === $exception->getMessage(); + }) + ); any([]) + ->then($this->expectCallableNever(), $mock); + } + + /** @test */ + public function shouldResolveToNullWithNonArrayInput() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo(null)); + + any(null) ->then($mock); } @@ -113,4 +133,64 @@ public function shouldNotRelyOnArryIndexesWhenUnwrappingToASingleResolutionValue $d2->resolve(2); $d1->resolve(1); } + + /** @test */ + public function shouldRejectWhenInputPromiseRejects() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo(null)); + + any(reject()) + ->then($this->expectCallableNever(), $mock); + } + + /** @test */ + public function shouldCancelInputPromise() + { + $mock = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock + ->expects($this->once()) + ->method('cancel'); + + any($mock)->cancel(); + } + + /** @test */ + public function shouldCancelInputArrayPromises() + { + $mock1 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock1 + ->expects($this->once()) + ->method('cancel'); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + any([$mock1, $mock2])->cancel(); + } + + /** @test */ + public function shouldCancelOtherPendingInputArrayPromisesIfOnePromiseFulfills() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->never()) + ->method('__invoke'); + + + $deferred = New Deferred($mock); + $deferred->resolve(); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + some([$deferred->promise(), $mock2], 1)->cancel(); + } } diff --git a/vendor/react/promise/tests/FunctionMapTest.php b/vendor/react/promise/tests/FunctionMapTest.php index b8bf3a83..5e86284e 100644 --- a/vendor/react/promise/tests/FunctionMapTest.php +++ b/vendor/react/promise/tests/FunctionMapTest.php @@ -122,4 +122,52 @@ public function shouldRejectWhenInputContainsRejection() $this->mapper() )->then($this->expectCallableNever(), $mock); } + + /** @test */ + public function shouldRejectWhenInputPromiseRejects() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo(null)); + + map( + reject(), + $this->mapper() + )->then($this->expectCallableNever(), $mock); + } + + /** @test */ + public function shouldCancelInputPromise() + { + $mock = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock + ->expects($this->once()) + ->method('cancel'); + + map( + $mock, + $this->mapper() + )->cancel(); + } + + /** @test */ + public function shouldCancelInputArrayPromises() + { + $mock1 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock1 + ->expects($this->once()) + ->method('cancel'); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + map( + [$mock1, $mock2], + $this->mapper() + )->cancel(); + } } diff --git a/vendor/react/promise/tests/FunctionRaceTest.php b/vendor/react/promise/tests/FunctionRaceTest.php index 553220c5..6cd1e987 100644 --- a/vendor/react/promise/tests/FunctionRaceTest.php +++ b/vendor/react/promise/tests/FunctionRaceTest.php @@ -119,4 +119,83 @@ public function shouldResolveToNullWhenInputPromiseDoesNotResolveToArray() resolve(1) )->then($mock); } + + /** @test */ + public function shouldRejectWhenInputPromiseRejects() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo(null)); + + race( + reject() + )->then($this->expectCallableNever(), $mock); + } + + /** @test */ + public function shouldCancelInputPromise() + { + $mock = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock + ->expects($this->once()) + ->method('cancel'); + + race($mock)->cancel(); + } + + /** @test */ + public function shouldCancelInputArrayPromises() + { + $mock1 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock1 + ->expects($this->once()) + ->method('cancel'); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + race([$mock1, $mock2])->cancel(); + } + + /** @test */ + public function shouldCancelOtherPendingInputArrayPromisesIfOnePromiseFulfills() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->never()) + ->method('__invoke'); + + $deferred = New Deferred($mock); + $deferred->resolve(); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + race([$deferred->promise(), $mock2])->cancel(); + } + + /** @test */ + public function shouldCancelOtherPendingInputArrayPromisesIfOnePromiseRejects() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->never()) + ->method('__invoke'); + + $deferred = New Deferred($mock); + $deferred->reject(); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + race([$deferred->promise(), $mock2])->cancel(); + } } diff --git a/vendor/react/promise/tests/FunctionReduceTest.php b/vendor/react/promise/tests/FunctionReduceTest.php index 715e8477..3c17511c 100644 --- a/vendor/react/promise/tests/FunctionReduceTest.php +++ b/vendor/react/promise/tests/FunctionReduceTest.php @@ -287,4 +287,55 @@ public function shouldProvideCorrectBasisValue() $d1->resolve(1); $d2->resolve(2); } + + /** @test */ + public function shouldRejectWhenInputPromiseRejects() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo(null)); + + reduce( + reject(), + $this->plus(), + 1 + )->then($this->expectCallableNever(), $mock); + } + + /** @test */ + public function shouldCancelInputPromise() + { + $mock = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock + ->expects($this->once()) + ->method('cancel'); + + reduce( + $mock, + $this->plus(), + 1 + )->cancel(); + } + + /** @test */ + public function shouldCancelInputArrayPromises() + { + $mock1 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock1 + ->expects($this->once()) + ->method('cancel'); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + reduce( + [$mock1, $mock2], + $this->plus(), + 1 + )->cancel(); + } } diff --git a/vendor/react/promise/tests/FunctionResolveTest.php b/vendor/react/promise/tests/FunctionResolveTest.php index 576c3093..216cbb0c 100644 --- a/vendor/react/promise/tests/FunctionResolveTest.php +++ b/vendor/react/promise/tests/FunctionResolveTest.php @@ -42,6 +42,35 @@ public function shouldResolveAFulfilledPromise() ); } + /** @test */ + public function shouldResolveAThenable() + { + $thenable = new SimpleFulfilledTestThenable(); + + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo('foo')); + + resolve($thenable) + ->then( + $mock, + $this->expectCallableNever() + ); + } + + /** @test */ + public function shouldResolveACancellableThenable() + { + $thenable = new SimpleTestCancellableThenable(); + + $promise = resolve($thenable); + $promise->cancel(); + + $this->assertTrue($thenable->cancelCalled); + } + /** @test */ public function shouldRejectARejectedPromise() { @@ -92,6 +121,44 @@ function ($val) { $result->then($mock); } + /** @test */ + public function shouldSupportVeryDeepNestedPromises() + { + $deferreds = []; + + // @TODO Increase count once global-queue is merged + for ($i = 0; $i < 10; $i++) { + $deferreds[] = $d = new Deferred(); + $p = $d->promise(); + + $last = $p; + for ($j = 0; $j < 10; $j++) { + $last = $last->then(function($result) { + return $result; + }); + } + } + + $p = null; + foreach ($deferreds as $d) { + if ($p) { + $d->resolve($p); + } + + $p = $d->promise(); + } + + $deferreds[0]->resolve(true); + + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo(true)); + + $deferreds[0]->promise()->then($mock); + } + /** @test */ public function returnsExtendePromiseForSimplePromise() { diff --git a/vendor/react/promise/tests/FunctionSomeTest.php b/vendor/react/promise/tests/FunctionSomeTest.php index 09e53504..374c84f0 100644 --- a/vendor/react/promise/tests/FunctionSomeTest.php +++ b/vendor/react/promise/tests/FunctionSomeTest.php @@ -2,20 +2,62 @@ namespace React\Promise; +use React\Promise\Exception\LengthException; + class FunctionSomeTest extends TestCase { /** @test */ - public function shouldResolveEmptyInput() + public function shouldRejectWithLengthExceptionWithEmptyInputArray() { $mock = $this->createCallableMock(); $mock ->expects($this->once()) ->method('__invoke') - ->with($this->identicalTo([])); + ->with( + $this->callback(function($exception){ + return $exception instanceof LengthException && + 'Input array must contain at least 1 item but contains only 0 items.' === $exception->getMessage(); + }) + ); some( [], 1 + )->then($this->expectCallableNever(), $mock); + } + + /** @test */ + public function shouldRejectWithLengthExceptionWithInputArrayContainingNotEnoughItems() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with( + $this->callback(function($exception){ + return $exception instanceof LengthException && + 'Input array must contain at least 4 items but contains only 3 items.' === $exception->getMessage(); + }) + ); + + some( + [1, 2, 3], + 4 + )->then($this->expectCallableNever(), $mock); + } + + /** @test */ + public function shouldResolveToEmptyArrayWithNonArrayInput() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo([])); + + some( + null, + 1 )->then($mock); } @@ -123,4 +165,84 @@ public function shouldResolveToEmptyArrayWhenInputPromiseDoesNotResolveToArray() 1 )->then($mock); } + + /** @test */ + public function shouldRejectWhenInputPromiseRejects() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->once()) + ->method('__invoke') + ->with($this->identicalTo(null)); + + some( + reject(), + 1 + )->then($this->expectCallableNever(), $mock); + } + + /** @test */ + public function shouldCancelInputPromise() + { + $mock = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock + ->expects($this->once()) + ->method('cancel'); + + some($mock, 1)->cancel(); + } + + /** @test */ + public function shouldCancelInputArrayPromises() + { + $mock1 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock1 + ->expects($this->once()) + ->method('cancel'); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + some([$mock1, $mock2], 1)->cancel(); + } + + /** @test */ + public function shouldCancelOtherPendingInputArrayPromisesIfEnoughPromisesFulfill() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->never()) + ->method('__invoke'); + + $deferred = New Deferred($mock); + $deferred->resolve(); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + some([$deferred->promise(), $mock2], 1); + } + + /** @test */ + public function shouldCancelOtherPendingInputArrayPromisesIfEnoughPromisesReject() + { + $mock = $this->createCallableMock(); + $mock + ->expects($this->never()) + ->method('__invoke'); + + $deferred = New Deferred($mock); + $deferred->reject(); + + $mock2 = $this->getMock('React\Promise\CancellablePromiseInterface'); + $mock2 + ->expects($this->once()) + ->method('cancel'); + + some([$deferred->promise(), $mock2], 2); + } } diff --git a/vendor/react/promise/tests/PromiseTest.php b/vendor/react/promise/tests/PromiseTest.php index faba7046..dc7b733d 100644 --- a/vendor/react/promise/tests/PromiseTest.php +++ b/vendor/react/promise/tests/PromiseTest.php @@ -82,35 +82,3 @@ public function shouldRejectIfRejectedWithSimplePromise() $adapter->resolve(new SimpleRejectedTestPromise()); } } - -class SimpleFulfilledTestPromise implements PromiseInterface -{ - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { - try { - if ($onFulfilled) { - $onFulfilled('foo'); - } - - return new self('foo'); - } catch (\Exception $exception) { - return new RejectedPromise($exception); - } - } -} - -class SimpleRejectedTestPromise implements PromiseInterface -{ - public function then(callable $onFulfilled = null, callable $onRejected = null, callable $onProgress = null) - { - try { - if ($onRejected) { - $onRejected('foo'); - } - - return new self('foo'); - } catch (\Exception $exception) { - return new RejectedPromise($exception); - } - } -} diff --git a/vendor/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php b/vendor/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php index 64255e83..98d1dcf9 100644 --- a/vendor/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php +++ b/vendor/react/promise/tests/PromiseTest/PromiseRejectedTestTrait.php @@ -3,6 +3,7 @@ namespace React\Promise\PromiseTest; use React\Promise\Deferred; +use React\Promise\UnhandledRejectionException; trait PromiseRejectedTestTrait { @@ -222,6 +223,25 @@ public function doneShouldThrowUnhandledRejectionExceptionWhenRejectedWithNonExc $this->assertNull($adapter->promise()->done()); } + /** @test */ + public function unhandledRejectionExceptionThrownByDoneHoldsRejectionValue() + { + $adapter = $this->getPromiseTestAdapter(); + + $expected = new \stdClass(); + + $adapter->reject($expected); + + try { + $adapter->promise()->done(); + } catch (UnhandledRejectionException $e) { + $this->assertSame($expected, $e->getReason()); + return; + } + + $this->fail(); + } + /** @test */ public function doneShouldThrowUnhandledRejectionExceptionWhenRejectionHandlerRejectsForRejectedPromise() { diff --git a/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php b/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php new file mode 100644 index 00000000..ef4d5301 --- /dev/null +++ b/vendor/react/promise/tests/fixtures/SimpleFulfilledTestPromise.php @@ -0,0 +1,21 @@ +cancelCalled = true; + } +} diff --git a/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php b/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php new file mode 100644 index 00000000..c0f15933 --- /dev/null +++ b/vendor/react/promise/tests/fixtures/SimpleTestCancellableThenable.php @@ -0,0 +1,18 @@ +cancelCalled = true; + } +} diff --git a/vendor/sebastian/environment/src/Console.php b/vendor/sebastian/environment/src/Console.php index 100c36d9..2aff1d65 100644 --- a/vendor/sebastian/environment/src/Console.php +++ b/vendor/sebastian/environment/src/Console.php @@ -84,13 +84,13 @@ public function getNumberOfColumns() return 80; } - if (preg_match('#\d+ (\d+)#', shell_exec('stty size'), $match) === 1) { + if (function_exists('shell_exec') && preg_match('#\d+ (\d+)#', shell_exec('stty size'), $match) === 1) { if ((int) $match[1] > 0) { return (int) $match[1]; } } - if (preg_match('#columns = (\d+);#', shell_exec('stty'), $match) === 1) { + if (function_exists('shell_exec') && preg_match('#columns = (\d+);#', shell_exec('stty'), $match) === 1) { if ((int) $match[1] > 0) { return (int) $match[1]; } diff --git a/vendor/sebastian/environment/src/Runtime.php b/vendor/sebastian/environment/src/Runtime.php index f12071a6..c8985b17 100644 --- a/vendor/sebastian/environment/src/Runtime.php +++ b/vendor/sebastian/environment/src/Runtime.php @@ -123,7 +123,7 @@ public function getVendorUrl() if ($this->isHHVM()) { return 'http://hhvm.com/'; } else { - return 'http://php.net/'; + return 'https://secure.php.net/'; } } diff --git a/vendor/sebastian/exporter/composer.json b/vendor/sebastian/exporter/composer.json index 723596e1..62b94bda 100644 --- a/vendor/sebastian/exporter/composer.json +++ b/vendor/sebastian/exporter/composer.json @@ -31,7 +31,8 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "~4.4", + "ext-mbstring": "*" }, "autoload": { "classmap": [ @@ -40,7 +41,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } } } diff --git a/vendor/sebastian/exporter/src/Exporter.php b/vendor/sebastian/exporter/src/Exporter.php index a9f5157c..5578aa8d 100644 --- a/vendor/sebastian/exporter/src/Exporter.php +++ b/vendor/sebastian/exporter/src/Exporter.php @@ -89,11 +89,10 @@ public function shortenedRecursiveExport(&$data, Context $context = null) * Exports a value into a single-line string * * The output of this method is similar to the output of - * SebastianBergmann\Exporter\Exporter::export. This method guarantees - * thought that the result contains now newlines. + * SebastianBergmann\Exporter\Exporter::export(). * - * Newlines are replaced by the visible string '\n'. Contents of arrays - * and objects (if any) are replaced by '...'. + * Newlines are replaced by the visible string '\n'. + * Contents of arrays and objects (if any) are replaced by '...'. * * @param mixed $value * @return string @@ -104,8 +103,14 @@ public function shortenedExport($value) if (is_string($value)) { $string = $this->export($value); - if (strlen($string) > 40) { - $string = substr($string, 0, 30) . '...' . substr($string, -7); + if (function_exists('mb_strlen')) { + if (mb_strlen($string) > 40) { + $string = mb_substr($string, 0, 30) . '...' . mb_substr($string, -7); + } + } else { + if (strlen($string) > 40) { + $string = substr($string, 0, 30) . '...' . substr($string, -7); + } } return str_replace("\n", '\n', $string); @@ -225,7 +230,7 @@ protected function recursiveExport(&$value, $indentation, $processed = null) if (is_string($value)) { // Match for most non printable chars somewhat taking multibyte chars into account - if (preg_match('/[^\x09-\x0d\x20-\xff]/', $value)) { + if (preg_match('/[^\x09-\x0d\x1b\x20-\xff]/', $value)) { return 'Binary String: 0x' . bin2hex($value); } diff --git a/vendor/sebastian/exporter/tests/ExporterTest.php b/vendor/sebastian/exporter/tests/ExporterTest.php index 6b590bfb..b0546f19 100644 --- a/vendor/sebastian/exporter/tests/ExporterTest.php +++ b/vendor/sebastian/exporter/tests/ExporterTest.php @@ -300,6 +300,31 @@ public function testShortenedExport($value, $expected) ); } + /** + * @requires extension mbstring + */ + public function testShortenedExportForMultibyteCharacters() + { + $oldMbLanguage = mb_language(); + mb_language('Japanese'); + $oldMbInternalEncoding = mb_internal_encoding(); + mb_internal_encoding('UTF-8'); + + try { + $this->assertSame( + "'いろはにほへとちりぬるをわかよたれそつねならむうゐのおくや...しゑひもせす'", + $this->trimNewline($this->exporter->shortenedExport('いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす')) + ); + } catch (\Exception $e) { + mb_internal_encoding($oldMbInternalEncoding); + mb_language($oldMbLanguage); + throw $e; + } + + mb_internal_encoding($oldMbInternalEncoding); + mb_language($oldMbLanguage); + } + public function provideNonBinaryMultibyteStrings() { return array( diff --git a/vendor/squizlabs/php_codesniffer/.gitignore b/vendor/squizlabs/php_codesniffer/.gitignore index f9f525aa..99658952 100644 --- a/vendor/squizlabs/php_codesniffer/.gitignore +++ b/vendor/squizlabs/php_codesniffer/.gitignore @@ -3,3 +3,4 @@ /phpunit.xml .idea/* /vendor/ +composer.lock diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer.php b/vendor/squizlabs/php_codesniffer/CodeSniffer.php index 19ea3e6e..91dbbffb 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer.php @@ -73,7 +73,7 @@ class PHP_CodeSniffer * * @var string */ - const VERSION = '2.5.1'; + const VERSION = '2.6.2'; /** * Package stability; either stable, beta or alpha. @@ -129,6 +129,16 @@ class PHP_CodeSniffer */ protected $sniffs = array(); + /** + * A mapping of sniff codes to fully qualified class names. + * + * The key is the sniff code and the value + * is the fully qualified name of the sniff class. + * + * @var array + */ + public $sniffCodes = array(); + /** * The listeners array, indexed by token type. * @@ -503,11 +513,12 @@ public function process($files, $standards, array $restrictions=array(), $local= * * @param string|array $standards The set of code sniffs we are testing * against. - * @param array $restrictions The sniff codes to restrict the + * @param array $restrictions The sniff codes to restrict the testing to. + * @param array $exclusions The sniff codes to exclude from testing. * * @return void */ - public function initStandard($standards, array $restrictions=array()) + public function initStandard($standards, array $restrictions=array(), array $exclusions=array()) { $standards = (array) $standards; @@ -537,7 +548,7 @@ public function initStandard($standards, array $restrictions=array()) } if (PHP_CODESNIFFER_VERBOSITY === 1) { - $ruleset = simplexml_load_string(file_get_contents($standard)); + $ruleset = simplexml_load_file($standard); if ($ruleset !== false) { $standardName = (string) $ruleset['name']; } @@ -557,7 +568,13 @@ public function initStandard($standards, array $restrictions=array()) $sniffRestrictions[] = $parts[0].'_sniffs_'.$parts[1].'_'.$parts[2].'sniff'; } - $this->registerSniffs($sniffs, $sniffRestrictions); + $sniffExclusions = array(); + foreach ($exclusions as $sniffCode) { + $parts = explode('.', strtolower($sniffCode)); + $sniffExclusions[] = $parts[0].'_sniffs_'.$parts[1].'_'.$parts[2].'sniff'; + } + + $this->registerSniffs($sniffs, $sniffRestrictions, $sniffExclusions); $this->populateTokenListeners(); if (PHP_CODESNIFFER_VERBOSITY === 1) { @@ -694,7 +711,7 @@ public function processRuleset($rulesetPath, $depth=0) echo "Processing ruleset $rulesetPath".PHP_EOL; } - $ruleset = simplexml_load_string(file_get_contents($rulesetPath)); + $ruleset = simplexml_load_file($rulesetPath); if ($ruleset === false) { throw new PHP_CodeSniffer_Exception("Ruleset $rulesetPath is not valid"); } @@ -705,7 +722,6 @@ public function processRuleset($rulesetPath, $depth=0) $cliValues = $this->cli->getCommandLineValues(); $rulesetDir = dirname($rulesetPath); - $rulesetName = basename($rulesetPath); self::$rulesetDirs[] = $rulesetDir; if (is_dir($rulesetDir.DIRECTORY_SEPARATOR.'Sniffs') === true) { @@ -717,6 +733,19 @@ public function processRuleset($rulesetPath, $depth=0) $ownSniffs = $this->_expandSniffDirectory($rulesetDir.DIRECTORY_SEPARATOR.'Sniffs', $depth); } + // Process custom sniff config settings. + foreach ($ruleset->{'config'} as $config) { + if ($this->_shouldProcessElement($config) === false) { + continue; + } + + $this->setConfigData((string) $config['name'], (string) $config['value'], true); + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo str_repeat("\t", $depth); + echo "\t=> set config value ".(string) $config['name'].': '.(string) $config['value'].PHP_EOL; + } + } + foreach ($ruleset->rule as $rule) { if (isset($rule['ref']) === false || $this->_shouldProcessElement($rule) === false @@ -818,7 +847,7 @@ public function processRuleset($rulesetPath, $depth=0) } }//end foreach - if (empty($cliValues['files']) === true) { + if (empty($cliValues['files']) === true && $cliValues['stdin'] === null) { // Process hard-coded file paths. foreach ($ruleset->{'file'} as $file) { $file = (string) $file; @@ -831,19 +860,19 @@ public function processRuleset($rulesetPath, $depth=0) } if (empty($cliArgs) === false) { - $this->cli->setCommandLineValues($cliArgs); - } - - // Process custom sniff config settings. - foreach ($ruleset->{'config'} as $config) { - if ($this->_shouldProcessElement($config) === false) { - continue; + // Change the directory so all relative paths are worked + // out based on the location of the ruleset instead of + // the location of the user. + $inPhar = self::isPharFile($rulesetDir); + if ($inPhar === false) { + $currentDir = getcwd(); + chdir($rulesetDir); } - $this->setConfigData((string) $config['name'], (string) $config['value'], true); - if (PHP_CODESNIFFER_VERBOSITY > 1) { - echo str_repeat("\t", $depth); - echo "\t=> set config value ".(string) $config['name'].': '.(string) $config['value'].PHP_EOL; + $this->cli->setCommandLineValues($cliArgs); + + if ($inPhar === false) { + chdir($currentDir); } } @@ -1312,11 +1341,13 @@ private function _shouldProcessElement($element, $depth=0) * @param array $files Paths to the sniff files to register. * @param array $restrictions The sniff class names to restrict the allowed * listeners to. + * @param array $exclusions The sniff class names to exclude from the + * listeners list. * * @return void * @throws PHP_CodeSniffer_Exception If a sniff file path is invalid. */ - public function registerSniffs($files, $restrictions) + public function registerSniffs($files, $restrictions, $exclusions) { $listeners = array(); @@ -1350,6 +1381,14 @@ public function registerSniffs($files, $restrictions) continue; } + // If they have specified a list of sniffs to exclude, check + // to see if this sniff is allowed. + if (empty($exclusions) === false + && in_array(strtolower($className), $exclusions) === true + ) { + continue; + } + include_once $file; // Support the use of PHP namespaces. If the class name we included @@ -1402,6 +1441,7 @@ public function populateTokenListeners() $code = substr($code, 0, -5); $this->listeners[$listenerClass] = new $listenerClass(); + $this->sniffCodes[$code] = $listenerClass; // Set custom properties. if (isset($this->ruleset[$code]['properties']) === true) { @@ -1694,6 +1734,7 @@ public function processFile($file, $contents=null) $firstContent = $contents; if ($contents === null && is_readable($filePath) === true) { $handle = fopen($filePath, 'r'); + stream_set_blocking($handle, true); if ($handle !== false) { $firstContent = fgets($handle); $firstContent .= fgets($handle); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.php index 6fa0195d..9ee1c033 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/CLI.php @@ -14,11 +14,13 @@ error_reporting(E_ALL | E_STRICT); -// Installations via Composer: make sure that we autoload all dependencies. -if (file_exists($a = dirname(__FILE__).'/../../../autoload.php') === true) { - include_once $a; -} else if (file_exists($a = dirname(__FILE__).'/../vendor/autoload.php') === true) { - include_once $a; +// Make sure that we autoload all dependencies if running via Composer. +if (version_compare(PHP_VERSION, '5.3.2', '>=') === true) { + if (file_exists($a = dirname(__FILE__).'/../../../autoload.php') === true) { + include_once $a; + } else if (file_exists($a = dirname(__FILE__).'/../vendor/autoload.php') === true) { + include_once $a; + } } if (file_exists($a = dirname(__FILE__).'/../CodeSniffer.php') === true) { @@ -243,7 +245,7 @@ public function runphpcbf() public function checkRequirements() { // Check the PHP version. - if (version_compare(PHP_VERSION, '5.1.2') === -1) { + if (version_compare(PHP_VERSION, '5.1.2', '<') === true) { echo 'ERROR: PHP_CodeSniffer requires PHP version 5.1.2 or greater.'.PHP_EOL; exit(2); } @@ -278,6 +280,7 @@ public function getDefaults() $defaults['showSources'] = false; $defaults['extensions'] = array(); $defaults['sniffs'] = array(); + $defaults['exclude'] = array(); $defaults['ignored'] = array(); $defaults['reportFile'] = null; $defaults['generator'] = ''; @@ -285,6 +288,8 @@ public function getDefaults() $defaults['bootstrap'] = array(); $defaults['errorSeverity'] = null; $defaults['warningSeverity'] = null; + $defaults['stdin'] = null; + $defaults['stdinPath'] = ''; $reportFormat = PHP_CodeSniffer::getConfigData('report_format'); if ($reportFormat !== null) { @@ -344,6 +349,13 @@ public function getDefaults() $defaults['showProgress'] = (bool) $showProgress; } + $quiet = PHP_CodeSniffer::getConfigData('quiet'); + if ($quiet === null) { + $defaults['quiet'] = false; + } else { + $defaults['quiet'] = (bool) $quiet; + } + $colors = PHP_CodeSniffer::getConfigData('colors'); if ($colors === null) { $defaults['colors'] = false; @@ -378,12 +390,27 @@ public function getCommandLineValues() return $this->values; } - $values = $this->getDefaults(); - $args = $_SERVER['argv']; array_shift($args); $this->setCommandLineValues($args); + + // Check for content on STDIN. + $handle = fopen('php://stdin', 'r'); + if (stream_set_blocking($handle, false) === true) { + $fileContents = ''; + while (($line = fgets(STDIN)) !== false) { + $fileContents .= $line; + usleep(10); + } + + stream_set_blocking($handle, true); + fclose($handle); + if (trim($fileContents) !== '') { + $this->values['stdin'] = $fileContents; + } + } + return $this->values; }//end getCommandLineValues() @@ -399,7 +426,7 @@ public function getCommandLineValues() public function setCommandLineValues($args) { if (defined('PHP_CODESNIFFER_IN_TESTS') === true) { - $this->values = array(); + $this->values = array('stdin' => null); } else if (empty($this->values) === true) { $this->values = $this->getDefaults(); } @@ -454,12 +481,15 @@ public function processShortArgument($arg, $pos) case '?': $this->printUsage(); exit(0); - break; case 'i' : $this->printInstalledStandards(); exit(0); - break; case 'v' : + if ($this->values['quiet'] === true) { + // Ignore when quiet mode is enabled. + break; + } + if (isset($this->values['verbosity']) === false) { $this->values['verbosity'] = 1; } else { @@ -479,8 +509,19 @@ public function processShortArgument($arg, $pos) $this->values['explain'] = true; break; case 'p' : + if ($this->values['quiet'] === true) { + // Ignore when quiet mode is enabled. + break; + } + $this->values['showProgress'] = true; break; + case 'q' : + // Quiet mode disables a few other settings as well. + $this->values['quiet'] = true; + $this->values['showProgress'] = false; + $this->values['verbosity'] = 0; + break; case 'd' : $ini = explode('=', $this->_cliArgs[($pos + 1)]); $this->_cliArgs[($pos + 1)] = ''; @@ -610,6 +651,17 @@ public function processLongArgument($arg, $pos) } $this->values['sniffs'] = $sniffs; + } else if (substr($arg, 0, 8) === 'exclude=') { + $sniffs = explode(',', substr($arg, 8)); + foreach ($sniffs as $sniff) { + if (substr_count($sniff, '.') !== 2) { + echo 'ERROR: The specified sniff code "'.$sniff.'" is invalid'.PHP_EOL.PHP_EOL; + $this->printUsage(); + exit(2); + } + } + + $this->values['exclude'] = $sniffs; } else if (substr($arg, 0, 10) === 'bootstrap=') { $files = explode(',', substr($arg, 10)); foreach ($files as $file) { @@ -622,6 +674,13 @@ public function processLongArgument($arg, $pos) $this->values['bootstrap'][] = $path; } + } else if (substr($arg, 0, 11) === 'stdin-path=') { + $this->values['stdinPath'] = PHP_CodeSniffer::realpath(substr($arg, 11)); + + // It may not exist and return false instead, so just use whatever they gave us. + if ($this->values['stdinPath'] === false) { + $this->values['stdinPath'] = trim(substr($arg, 11)); + } } else if (substr($arg, 0, 12) === 'report-file=') { $this->values['reportFile'] = PHP_CodeSniffer::realpath(substr($arg, 12)); @@ -696,6 +755,10 @@ public function processLongArgument($arg, $pos) $this->values['standard'] = explode(',', $standards); } } else if (substr($arg, 0, 11) === 'extensions=') { + if (isset($this->values['extensions']) === false) { + $this->values['extensions'] = array(); + } + $this->values['extensions'] = array_merge($this->values['extensions'], explode(',', substr($arg, 11))); } else if (substr($arg, 0, 9) === 'severity=') { $this->values['errorSeverity'] = (int) substr($arg, 9); @@ -841,7 +904,7 @@ public function process($values=array()) $phpcs = new PHP_CodeSniffer($values['verbosity'], null, null, null); $phpcs->setCli($this); - $phpcs->initStandard($values['standard'], $values['sniffs']); + $phpcs->initStandard($values['standard'], $values['sniffs'], $values['exclude']); $values = $this->values; $phpcs->setTabWidth($values['tabWidth']); @@ -885,11 +948,15 @@ public function process($values=array()) $phpcs->processFiles($values['files'], $values['local']); - if (empty($values['files']) === true) { - // Check if they are passing in the file contents. - $handle = fopen('php://stdin', 'r'); - $fileContents = stream_get_contents($handle); - fclose($handle); + if (empty($values['files']) === true || $values['stdin'] !== null) { + $fileContents = $values['stdin']; + if ($fileContents === null) { + // Check if they are passing in the file contents. + $handle = fopen('php://stdin', 'r'); + stream_set_blocking($handle, true); + $fileContents = stream_get_contents($handle); + fclose($handle); + } if ($fileContents === '') { // No files and no content passed in. @@ -897,9 +964,7 @@ public function process($values=array()) $this->printUsage(); exit(2); } else { - if ($fileContents !== '') { - $phpcs->processFile('STDIN', $fileContents); - } + $phpcs->processFile('STDIN', $fileContents); } } @@ -1051,7 +1116,7 @@ public function validateStandard($standards) $standard = 'PEAR'; } - return array($standard); + return explode(',', $standard); }//end if $cleaned = array(); @@ -1185,12 +1250,12 @@ public function printUsage() */ public function printPHPCSUsage() { - echo 'Usage: phpcs [-nwlsaepvi] [-d key[=value]] [--colors] [--no-colors]'.PHP_EOL; + echo 'Usage: phpcs [-nwlsaepqvi] [-d key[=value]] [--colors] [--no-colors] [--stdin-path=]'.PHP_EOL; echo ' [--report=] [--report-file=] [--report-=] ...'.PHP_EOL; echo ' [--report-width=] [--generator=] [--tab-width=]'.PHP_EOL; echo ' [--severity=] [--error-severity=] [--warning-severity=]'.PHP_EOL; echo ' [--runtime-set key value] [--config-set key value] [--config-delete key] [--config-show]'.PHP_EOL; - echo ' [--standard=] [--sniffs=] [--encoding=]'.PHP_EOL; + echo ' [--standard=] [--sniffs=] [--exclude=] [--encoding=]'.PHP_EOL; echo ' [--extensions=] [--ignore=] [--bootstrap=] ...'.PHP_EOL; echo ' Set runtime value (see --config-set) '.PHP_EOL; echo ' -n Do not print warnings (shortcut for --warning-severity=0)'.PHP_EOL; @@ -1200,6 +1265,7 @@ public function printPHPCSUsage() echo ' -a Run interactively'.PHP_EOL; echo ' -e Explain a standard by showing the sniffs it includes'.PHP_EOL; echo ' -p Show progress of the run'.PHP_EOL; + echo ' -q Quiet mode; disables progress and verbose output'.PHP_EOL; echo ' -v[v][v] Print verbose output'.PHP_EOL; echo ' -i Show a list of installed coding standards'.PHP_EOL; echo ' -d Set the [key] php.ini value to [value] or [true] if value is omitted'.PHP_EOL; @@ -1208,23 +1274,24 @@ public function printPHPCSUsage() echo ' --colors Use colors in output'.PHP_EOL; echo ' --no-colors Do not use colors in output (this is the default)'.PHP_EOL; echo ' One or more files and/or directories to check'.PHP_EOL; + echo ' If processing STDIN, the file path that STDIN will be processed as '.PHP_EOL; echo ' A comma separated list of files to run before processing starts'.PHP_EOL; echo ' The encoding of the files being checked (default is iso-8859-1)'.PHP_EOL; echo ' A comma separated list of file extensions to check'.PHP_EOL; echo ' (extension filtering only valid when checking a directory)'.PHP_EOL; echo ' The type of the file can be specified using: ext/type'.PHP_EOL; echo ' e.g., module/php,es/js'.PHP_EOL; - echo ' Uses either the "HMTL", "Markdown" or "Text" generator'.PHP_EOL; + echo ' Uses either the "HTML", "Markdown" or "Text" generator'.PHP_EOL; echo ' (forces documentation generation instead of checking)'.PHP_EOL; echo ' A comma separated list of patterns to ignore files and directories'.PHP_EOL; echo ' Print either the "full", "xml", "checkstyle", "csv"'.PHP_EOL; - echo ' "json", "emacs", "source", "summary", "diff"'.PHP_EOL; + echo ' "json", "emacs", "source", "summary", "diff", "junit"'.PHP_EOL; echo ' "svnblame", "gitblame", "hgblame" or "notifysend" report'.PHP_EOL; echo ' (the "full" report is printed by default)'.PHP_EOL; echo ' Write the report to the specified file path'.PHP_EOL; echo ' How many columns wide screen reports should be printed'.PHP_EOL; echo ' or set to "auto" to use current screen width, where supported'.PHP_EOL; - echo ' A comma separated list of sniff codes to limit the check to'.PHP_EOL; + echo ' A comma separated list of sniff codes to include or exclude during checking'.PHP_EOL; echo ' (all sniffs must be part of the specified standard)'.PHP_EOL; echo ' The minimum severity required to display an error or warning'.PHP_EOL; echo ' The name or path of the coding standard to use'.PHP_EOL; @@ -1240,8 +1307,8 @@ public function printPHPCSUsage() */ public function printPHPCBFUsage() { - echo 'Usage: phpcbf [-nwli] [-d key[=value]]'.PHP_EOL; - echo ' [--standard=] [--sniffs=] [--suffix=]'.PHP_EOL; + echo 'Usage: phpcbf [-nwli] [-d key[=value]] [--stdin-path=]'.PHP_EOL; + echo ' [--standard=] [--sniffs=] [--exclude=] [--suffix=]'.PHP_EOL; echo ' [--severity=] [--error-severity=] [--warning-severity=]'.PHP_EOL; echo ' [--tab-width=] [--encoding=]'.PHP_EOL; echo ' [--extensions=] [--ignore=] [--bootstrap=] ...'.PHP_EOL; @@ -1254,6 +1321,7 @@ public function printPHPCBFUsage() echo ' --version Print version information'.PHP_EOL; echo ' --no-patch Do not make use of the "diff" or "patch" programs'.PHP_EOL; echo ' One or more files and/or directories to fix'.PHP_EOL; + echo ' If processing STDIN, the file path that STDIN will be processed as '.PHP_EOL; echo ' A comma separated list of files to run before processing starts'.PHP_EOL; echo ' The encoding of the files being fixed (default is iso-8859-1)'.PHP_EOL; echo ' A comma separated list of file extensions to fix'.PHP_EOL; @@ -1261,7 +1329,7 @@ public function printPHPCBFUsage() echo ' The type of the file can be specified using: ext/type'.PHP_EOL; echo ' e.g., module/php,es/js'.PHP_EOL; echo ' A comma separated list of patterns to ignore files and directories'.PHP_EOL; - echo ' A comma separated list of sniff codes to limit the fixes to'.PHP_EOL; + echo ' A comma separated list of sniff codes to include or exclude during fixing'.PHP_EOL; echo ' (all sniffs must be part of the specified standard)'.PHP_EOL; echo ' The minimum severity required to fix an error or warning'.PHP_EOL; echo ' The name or path of the coding standard to use'.PHP_EOL; @@ -1304,7 +1372,7 @@ public function printInstalledStandards() * @param int $width The width of the report. If "auto" then will * be replaced by the terminal width. * - * @return void + * @return int */ private function _validateReportWidth($width) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/File.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/File.php index 4f1a2975..36cc44f8 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/File.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/File.php @@ -459,8 +459,11 @@ public function start($contents=null) // If this is standard input, see if a filename was passed in as well. // This is done by including: phpcs_input_file: [file path] // as the first line of content. - if ($this->_file === 'STDIN' && $contents !== null) { - if (substr($contents, 0, 17) === 'phpcs_input_file:') { + if ($this->_file === 'STDIN') { + $cliValues = $this->phpcs->cli->getCommandLineValues(); + if ($cliValues['stdinPath'] !== '') { + $this->_file = $cliValues['stdinPath']; + } else if ($contents !== null && substr($contents, 0, 17) === 'phpcs_input_file:') { $eolPos = strpos($contents, $this->eolChar); $filename = trim(substr($contents, 17, ($eolPos - 17))); $contents = substr($contents, ($eolPos + strlen($this->eolChar))); @@ -498,12 +501,15 @@ public function start($contents=null) $this->_fixableCount = 0; return; } else if (strpos($token['content'], '@codingStandardsChangeSetting') !== false) { - $start = strpos($token['content'], '@codingStandardsChangeSetting'); - $comment = substr($token['content'], ($start + 30)); - $parts = explode(' ', $comment); - $sniffParts = explode('.', $parts[0]); - $listenerClass = $sniffParts[0].'_Sniffs_'.$sniffParts[1].'_'.$sniffParts[2].'Sniff'; - $this->phpcs->setSniffProperty($listenerClass, $parts[1], $parts[2]); + $start = strpos($token['content'], '@codingStandardsChangeSetting'); + $comment = substr($token['content'], ($start + 30)); + $parts = explode(' ', $comment); + if (count($parts) >= 3 + && isset($this->phpcs->sniffCodes[$parts[0]]) === true + ) { + $listenerClass = $this->phpcs->sniffCodes[$parts[0]]; + $this->phpcs->setSniffProperty($listenerClass, $parts[1], $parts[2]); + } }//end if }//end if }//end if @@ -861,8 +867,8 @@ public function addWarning( * @param int $line The line on which the error occurred. * @param string $code A violation code unique to the sniff message. * @param array $data Replacements for the error message. - * @param int $severity The severity level for this error. A value of 0 will be converted into the default severity level. - * will be converted into the default severity level. + * @param int $severity The severity level for this error. A value of 0 + * will be converted into the default severity level. * * @return boolean */ @@ -885,8 +891,8 @@ public function addErrorOnLine( * @param int $line The line on which the warning occurred. * @param string $code A violation code unique to the sniff message. * @param array $data Replacements for the warning message. - * @param int $severity The severity level for this warning. A value of 0 will be converted into the default severity level. - * will be converted into the default severity level. + * @param int $severity The severity level for this warning. A value of 0 + * will be converted into the default severity level. * * @return boolean */ @@ -987,7 +993,6 @@ private function _addError($error, $line, $column, $code, $data, $severity, $fix // Work out which sniff generated the error. if (substr($code, 0, 9) === 'Internal.') { // Any internal message. - $sniff = $code; $sniffCode = $code; } else { $parts = explode('_', str_replace('\\', '_', $this->_activeListener)); @@ -1135,7 +1140,6 @@ private function _addWarning($warning, $line, $column, $code, $data, $severity, // Work out which sniff generated the warning. if (substr($code, 0, 9) === 'Internal.') { // Any internal message. - $sniff = $code; $sniffCode = $code; } else { $parts = explode('_', str_replace('\\', '_', $this->_activeListener)); @@ -1417,7 +1421,9 @@ public static function tokenizeString($string, $tokenizer, $eolChar='\n', $tabWi { // Minified files often have a very large number of characters per line // and cause issues when tokenizing. - if (get_class($tokenizer) !== 'PHP_CodeSniffer_Tokenizers_PHP') { + if (property_exists($tokenizer, 'skipMinified') === true + && $tokenizer->skipMinified === true + ) { $numChars = strlen($string); $numLines = (substr_count($string, $eolChar) + 1); $average = ($numChars / $numLines); @@ -1755,6 +1761,13 @@ private static function _createTokenMap(&$tokens, $tokenizer, $eolChar) }//end switch }//end for + // Cleanup for any openers that we didn't find closers for. + // This typically means there was a syntax error breaking things. + foreach ($openers as $opener) { + unset($tokens[$opener]['parenthesis_opener']); + unset($tokens[$opener]['parenthesis_owner']); + } + if (PHP_CODESNIFFER_VERBOSITY > 1) { echo "\t*** END TOKEN MAP ***".PHP_EOL; } @@ -1821,10 +1834,6 @@ private static function _createScopeMap(&$tokens, $tokenizer, $eolChar) { if (PHP_CODESNIFFER_VERBOSITY > 1) { echo "\t*** START SCOPE MAP ***".PHP_EOL; - $isWin = false; - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $isWin = true; - } } $numTokens = count($tokens); @@ -1888,11 +1897,6 @@ private static function _recurseScopeMap( if (PHP_CODESNIFFER_VERBOSITY > 1) { echo str_repeat("\t", $depth); echo "=> Begin scope map recursion at token $stackPtr with depth $depth".PHP_EOL; - - $isWin = false; - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $isWin = true; - } } $opener = null; @@ -1948,6 +1952,20 @@ private static function _recurseScopeMap( return $i; } + if ($opener === null + && $ignore === 0 + && $tokenType === T_CLOSE_CURLY_BRACKET + && isset($tokenizer->scopeOpeners[$currType]['end'][$tokenType]) === true + ) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $tokens[$stackPtr]['type']; + echo str_repeat("\t", $depth); + echo "=> Found curly brace closer before scope opener for $stackPtr:$type, bailing".PHP_EOL; + } + + return ($i - 1); + } + if ($opener !== null && (isset($tokens[$i]['scope_opener']) === false || $tokenizer->scopeOpeners[$tokens[$stackPtr]['code']]['shared'] === true) @@ -2113,10 +2131,27 @@ private static function _recurseScopeMap( if (PHP_CODESNIFFER_VERBOSITY > 1) { $type = $tokens[$stackPtr]['type']; echo str_repeat("\t", $depth); - echo "=> Found new opening condition before scope opener for $stackPtr:$type, bailing".PHP_EOL; + echo "=> Found new opening condition before scope opener for $stackPtr:$type, "; } - return $stackPtr; + if (($tokens[$stackPtr]['code'] === T_IF + || $tokens[$stackPtr]['code'] === T_ELSEIF + || $tokens[$stackPtr]['code'] === T_ELSE) + && ($tokens[$i]['code'] === T_ELSE + || $tokens[$i]['code'] === T_ELSEIF) + ) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "continuing".PHP_EOL; + } + + return ($i - 1); + } else { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + echo "backtracking".PHP_EOL; + } + + return $stackPtr; + } }//end if if (PHP_CODESNIFFER_VERBOSITY > 1) { @@ -3213,9 +3248,9 @@ public function getTokensAsString($start, $length) /** - * Returns the position of the next specified token(s). + * Returns the position of the previous specified token(s). * - * If a value is specified, the next token of the specified type(s) + * If a value is specified, the previous token of the specified type(s) * containing the specified value will be returned. * * Returns false if no token can be found. @@ -3226,14 +3261,14 @@ public function getTokensAsString($start, $length) * @param int $end The end position to fail if no token is found. * if not specified or null, end will default to * the start of the token stack. - * @param bool $exclude If true, find the next token that are NOT of + * @param bool $exclude If true, find the previous token that are NOT of * the types specified in $types. * @param string $value The value that the token(s) must be equal to. * If value is omitted, tokens with any value will * be returned. * @param bool $local If true, tokens outside the current statement * will not be checked. IE. checking will stop - * at the next semi-colon found. + * at the previous semi-colon found. * * @return int|bool * @see findNext() @@ -3363,11 +3398,12 @@ public function findNext( /** * Returns the position of the first non-whitespace token in a statement. * - * @param int $start The position to start searching from in the token stack. + * @param int $start The position to start searching from in the token stack. + * @param int|array $ignore Token types that should not be considered stop points. * * @return int */ - public function findStartOfStatement($start) + public function findStartOfStatement($start, $ignore=null) { $endTokens = PHP_CodeSniffer_Tokens::$blockOpeners; @@ -3379,6 +3415,15 @@ public function findStartOfStatement($start) $endTokens[T_CLOSE_TAG] = true; $endTokens[T_OPEN_SHORT_ARRAY] = true; + if ($ignore !== null) { + $ignore = (array) $ignore; + foreach ($ignore as $code) { + if (isset($endTokens[$code]) === true) { + unset($endTokens[$code]); + } + } + } + $lastNotEmpty = $start; for ($i = $start; $i >= 0; $i--) { @@ -3418,11 +3463,12 @@ public function findStartOfStatement($start) /** * Returns the position of the last non-whitespace token in a statement. * - * @param int $start The position to start searching from in the token stack. + * @param int $start The position to start searching from in the token stack. + * @param int|array $ignore Token types that should not be considered stop points. * * @return int */ - public function findEndOfStatement($start) + public function findEndOfStatement($start, $ignore=null) { $endTokens = array( T_COLON => true, @@ -3437,6 +3483,15 @@ public function findEndOfStatement($start) T_CLOSE_TAG => true, ); + if ($ignore !== null) { + $ignore = (array) $ignore; + foreach ($ignore as $code) { + if (isset($endTokens[$code]) === true) { + unset($endTokens[$code]); + } + } + } + $lastNotEmpty = $start; for ($i = $start; $i < $this->numTokens; $i++) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Fixer.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Fixer.php index 4131fd88..9954255d 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Fixer.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Fixer.php @@ -427,6 +427,41 @@ public function endChangeset() }//end endChangeset() + /** + * Stop recording actions for a changeset, and discard logged changes. + * + * @return void + */ + public function rollbackChangeset() + { + $this->_inChangeset = false; + $this->_inConflict = false; + + if (empty($this->_changeset) === false) { + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $bt = debug_backtrace(); + if ($bt[1]['class'] === 'PHP_CodeSniffer_Fixer') { + $sniff = $bt[2]['class']; + $line = $bt[1]['line']; + } else { + $sniff = $bt[1]['class']; + $line = $bt[0]['line']; + } + + $numChanges = count($this->_changeset); + + @ob_end_clean(); + echo "\t\tR: $sniff (line $line) rolled back the changeset ($numChanges changes)".PHP_EOL; + echo "\t=> Changeset rolled back".PHP_EOL; + ob_start(); + } + + $this->_changeset = array(); + }//end if + + }//end rollbackChangeset() + + /** * Replace the entire contents of a token. * diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Reports/VersionControl.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Reports/VersionControl.php index 6342848d..80c51b22 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Reports/VersionControl.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Reports/VersionControl.php @@ -107,9 +107,12 @@ public function generateFileReport( if ($showSources === true) { $source = $error['source']; if (isset($this->_sourceCache[$author][$source]) === false) { - $this->_sourceCache[$author][$source] = 1; + $this->_sourceCache[$author][$source] = array( + 'count' => 1, + 'fixable' => $error['fixable'], + ); } else { - $this->_sourceCache[$author][$source]++; + $this->_sourceCache[$author][$source]['count']++; } } } @@ -183,7 +186,7 @@ public function generate( foreach ($this->_authorCache as $author => $count) { $maxLength = max($maxLength, strlen($author)); if ($showSources === true && isset($this->_sourceCache[$author]) === true) { - foreach ($this->_sourceCache[$author] as $source => $count) { + foreach ($this->_sourceCache[$author] as $source => $sourceData) { if ($source === 'count') { continue; } @@ -209,6 +212,16 @@ public function generate( echo "\033[0m"; + if ($showSources === true) { + $maxSniffWidth = ($width - 15); + + if ($totalFixable > 0) { + $maxSniffWidth -= 4; + } + } + + $fixableSources = 0; + foreach ($this->_authorCache as $author => $count) { if ($this->_praiseCache[$author]['good'] === 0) { $percent = 0; @@ -235,15 +248,43 @@ public function generate( asort($errors); $errors = array_reverse($errors); - foreach ($errors as $source => $count) { + foreach ($errors as $source => $sourceData) { if ($source === 'count') { continue; } + $count = $sourceData['count']; + + $srcLength = strlen($source); + if ($srcLength > $maxSniffWidth) { + $source = substr($source, 0, $maxSniffWidth); + } + $line = str_repeat(' ', (5 - strlen($count))).$count; - echo ' '.$source.str_repeat(' ', ($width - 14 - strlen($source))).$line.PHP_EOL; - } - } + + echo ' '; + if ($totalFixable > 0) { + echo '['; + if ($sourceData['fixable'] === true) { + echo 'x'; + $fixableSources++; + } else { + echo ' '; + } + + echo '] '; + } + + echo $source; + if ($totalFixable > 0) { + echo str_repeat(' ', ($width - 18 - strlen($source))); + } else { + echo str_repeat(' ', ($width - 14 - strlen($source))); + } + + echo $line.PHP_EOL; + }//end foreach + }//end if }//end foreach echo str_repeat('-', $width).PHP_EOL; @@ -260,8 +301,13 @@ public function generate( echo "\033[0m"; if ($totalFixable > 0) { - echo PHP_EOL.str_repeat('-', $width).PHP_EOL; - echo "\033[1mPHPCBF CAN FIX $totalFixable OF THESE SNIFF VIOLATIONS AUTOMATICALLY\033[0m"; + if ($showSources === true) { + echo PHP_EOL.str_repeat('-', $width).PHP_EOL; + echo "\033[1mPHPCBF CAN FIX THE $fixableSources MARKED SOURCES AUTOMATICALLY ($totalFixable VIOLATIONS IN TOTAL)\033[0m"; + } else { + echo PHP_EOL.str_repeat('-', $width).PHP_EOL; + echo "\033[1mPHPCBF CAN FIX $totalFixable OF THESE SNIFF VIOLATIONS AUTOMATICALLY\033[0m"; + } } echo PHP_EOL.str_repeat('-', $width).PHP_EOL.PHP_EOL; diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php index 53388d3c..913789c9 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/ControlStructures/InlineControlStructureSniff.php @@ -134,107 +134,121 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $phpcsFile->recordMetric($stackPtr, 'Control structure defined inline', 'yes'); - if ($fix === true) { - $phpcsFile->fixer->beginChangeset(); - if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { - $closer = $tokens[$stackPtr]['parenthesis_closer']; - } else { - $closer = $stackPtr; + // Stop here if we are not fixing the error. + if ($fix !== true) { + return; + } + + $phpcsFile->fixer->beginChangeset(); + if (isset($tokens[$stackPtr]['parenthesis_closer']) === true) { + $closer = $tokens[$stackPtr]['parenthesis_closer']; + } else { + $closer = $stackPtr; + } + + if ($tokens[($closer + 1)]['code'] === T_WHITESPACE + || $tokens[($closer + 1)]['code'] === T_SEMICOLON + ) { + $phpcsFile->fixer->addContent($closer, ' {'); + } else { + $phpcsFile->fixer->addContent($closer, ' { '); + } + + $fixableScopeOpeners = $this->register(); + + $lastNonEmpty = $closer; + for ($end = ($closer + 1); $end < $phpcsFile->numTokens; $end++) { + if ($tokens[$end]['code'] === T_SEMICOLON) { + break; } - if ($tokens[($closer + 1)]['code'] === T_WHITESPACE - || $tokens[($closer + 1)]['code'] === T_SEMICOLON + if ($tokens[$end]['code'] === T_CLOSE_TAG) { + $end = $lastNonEmpty; + break; + } + + if (in_array($tokens[$end]['code'], $fixableScopeOpeners) === true + && isset($tokens[$end]['scope_opener']) === false ) { - $phpcsFile->fixer->addContent($closer, ' {'); - } else { - $phpcsFile->fixer->addContent($closer, ' { '); + // The best way to fix nested inline scopes is middle-out. + // So skip this one. It will be detected and fixed on a future loop. + $phpcsFile->fixer->rollbackChangeset(); + return; } - $lastNonEmpty = $closer; - for ($end = ($closer + 1); $end < $phpcsFile->numTokens; $end++) { - if ($tokens[$end]['code'] === T_SEMICOLON) { - break; - } + if (isset($tokens[$end]['scope_opener']) === true) { + $type = $tokens[$end]['code']; + $end = $tokens[$end]['scope_closer']; + if ($type === T_DO || $type === T_IF || $type === T_ELSEIF) { + $next = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($end + 1), null, true); + if ($next === false) { + break; + } - if ($tokens[$end]['code'] === T_CLOSE_TAG) { - $end = $lastNonEmpty; - break; - } + $nextType = $tokens[$next]['code']; - if (isset($tokens[$end]['scope_opener']) === true) { - $type = $tokens[$end]['code']; - $end = $tokens[$end]['scope_closer']; - if ($type === T_DO || $type === T_IF || $type === T_ELSEIF) { - $next = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($end + 1), null, true); - if ($next === false) { - break; - } - - $nextType = $tokens[$next]['code']; - - // Let additional conditions loop and find their ending. - if (($type === T_IF - || $type === T_ELSEIF) - && ($nextType === T_ELSEIF - || $nextType === T_ELSE) - ) { - continue; - } - - // Account for DO... WHILE conditions. - if ($type === T_DO && $nextType === T_WHILE) { - $end = $phpcsFile->findNext(T_SEMICOLON, ($next + 1)); - } - }//end if - - break; - }//end if + // Let additional conditions loop and find their ending. + if (($type === T_IF + || $type === T_ELSEIF) + && ($nextType === T_ELSEIF + || $nextType === T_ELSE) + ) { + continue; + } - if ($tokens[$end]['code'] !== T_WHITESPACE) { - $lastNonEmpty = $end; - } - }//end for + // Account for DO... WHILE conditions. + if ($type === T_DO && $nextType === T_WHILE) { + $end = $phpcsFile->findNext(T_SEMICOLON, ($next + 1)); + } + }//end if - $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), ($end + 1), true); + break; + }//end if - // Account for a comment on the end of the line. - for ($endLine = $end; $endLine < $phpcsFile->numTokens; $endLine++) { - if (isset($tokens[($endLine + 1)]) === false - || $tokens[$endLine]['line'] !== $tokens[($endLine + 1)]['line'] - ) { - break; - } + if ($tokens[$end]['code'] !== T_WHITESPACE) { + $lastNonEmpty = $end; } + }//end for + + $next = $phpcsFile->findNext(T_WHITESPACE, ($closer + 1), ($end + 1), true); - if ($tokens[$endLine]['code'] !== T_COMMENT) { - $endLine = $end; + // Account for a comment on the end of the line. + for ($endLine = $end; $endLine < $phpcsFile->numTokens; $endLine++) { + if (isset($tokens[($endLine + 1)]) === false + || $tokens[$endLine]['line'] !== $tokens[($endLine + 1)]['line'] + ) { + break; } + } - if ($next !== $end) { - if ($endLine !== $end) { - $phpcsFile->fixer->addContent($endLine, '}'); - } else { - if ($tokens[$end]['code'] !== T_SEMICOLON - && $tokens[$end]['code'] !== T_CLOSE_CURLY_BRACKET - ) { - $phpcsFile->fixer->addContent($end, ';'); - } + if ($tokens[$endLine]['code'] !== T_COMMENT) { + $endLine = $end; + } - $phpcsFile->fixer->addContent($end, ' }'); - } + if ($next !== $end) { + if ($endLine !== $end) { + $phpcsFile->fixer->addContent($endLine, '}'); } else { - if ($endLine !== $end) { - $phpcsFile->fixer->replaceToken($end, ''); - $phpcsFile->fixer->addNewlineBefore($endLine); - $phpcsFile->fixer->addContent($endLine, '}'); - } else { - $phpcsFile->fixer->replaceToken($end, '}'); + if ($tokens[$end]['code'] !== T_SEMICOLON + && $tokens[$end]['code'] !== T_CLOSE_CURLY_BRACKET + ) { + $phpcsFile->fixer->addContent($end, ';'); } - }//end if - $phpcsFile->fixer->endChangeset(); + $phpcsFile->fixer->addContent($end, ' }'); + } + } else { + if ($endLine !== $end) { + $phpcsFile->fixer->replaceToken($end, ''); + $phpcsFile->fixer->addNewlineBefore($endLine); + $phpcsFile->fixer->addContent($endLine, '}'); + } else { + $phpcsFile->fixer->replaceToken($end, '}'); + } }//end if + $phpcsFile->fixer->endChangeset(); + }//end process() diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/LineLengthSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/LineLengthSniff.php index 50d97780..d64c2add 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/LineLengthSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Files/LineLengthSniff.php @@ -127,6 +127,30 @@ protected function checkLineLength(PHP_CodeSniffer_File $phpcsFile, $tokens, $st $phpcsFile->recordMetric($stackPtr, 'Line length', '151 or more'); } + // If this is a long comment, check if it can be broken up onto multiple lines. + // Some comments contain unbreakable strings like URLs and so it makes sense + // to ignore the line length in these cases if the URL would be longer than the max + // line length once you indent it to the correct level. + if ($lineLength > $this->lineLimit + && ($tokens[$stackPtr]['code'] === T_COMMENT + || $tokens[$stackPtr]['code'] === T_DOC_COMMENT_STRING) + ) { + $oldLength = strlen($tokens[$stackPtr]['content']); + $newLength = strlen(ltrim($tokens[$stackPtr]['content'], "/#\t ")); + $indent = (($tokens[$stackPtr]['column'] - 1) + ($oldLength - $newLength)); + + $nonBreakingLength = $tokens[$stackPtr]['length']; + + $space = strrpos($tokens[$stackPtr]['content'], ' '); + if ($space !== false) { + $nonBreakingLength -= ($space + 1); + } + + if (($nonBreakingLength + $indent) > $this->lineLimit) { + return; + } + } + if ($this->absoluteLineLimit > 0 && $lineLength > $this->absoluteLineLimit ) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php index 837e8e1b..7d958dde 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/MultipleStatementAlignmentSniff.php @@ -257,6 +257,8 @@ public function checkAlignment(PHP_CodeSniffer_File $phpcsFile, $stackPtr) return $stackPtr; } + $numAssignments = count($assignments); + $errorGenerated = false; foreach ($assignments as $assignment => $data) { if ($data['found'] === $data['expected']) { @@ -277,7 +279,7 @@ public function checkAlignment(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } } - if (count($assignments) === 1) { + if ($numAssignments === 1) { $type = 'Incorrect'; $error = 'Equals sign not aligned correctly; expected %s but found %s'; } else { @@ -308,10 +310,12 @@ public function checkAlignment(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } }//end foreach - if ($errorGenerated === true) { - $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'no'); - } else { - $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'yes'); + if ($numAssignments > 1) { + if ($errorGenerated === true) { + $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'no'); + } else { + $phpcsFile->recordMetric($stackPtr, 'Adjacent assignments aligned', 'yes'); + } } if ($stopped !== null) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php new file mode 100644 index 00000000..3620926e --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Formatting/SpaceAfterNotSniff.php @@ -0,0 +1,90 @@ + + * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * Generic_Sniffs_Formatting_SpaceAfterNotSniff. + * + * Ensures there is a single space after a NOT operator. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHP_CodeSniffer + */ +class Generic_Sniffs_Formatting_SpaceAfterNotSniff implements PHP_CodeSniffer_Sniff +{ + + /** + * A list of tokenizers this sniff supports. + * + * @var array + */ + public $supportedTokenizers = array( + 'PHP', + 'JS', + ); + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return array(T_BOOLEAN_NOT); + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param PHP_CodeSniffer_File $phpcsFile All the tokens found in the document. + * @param int $stackPtr The position of the current token in + * the stack passed in $tokens. + * + * @return void + */ + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + $spacing = 0; + if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE) { + $spacing = $tokens[($stackPtr + 1)]['length']; + } + + if ($spacing === 1) { + return; + } + + $message = 'There must be a single space after a NOT operator; %s found'; + $fix = $phpcsFile->addFixableError($message, $stackPtr, 'Incorrect', array($spacing)); + + if ($fix === true) { + if ($spacing === 0) { + $phpcsFile->fixer->addContent($stackPtr, ' '); + } else { + $phpcsFile->fixer->replaceToken(($stackPtr + 1), ' '); + } + } + + }//end process() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php index 3e1f6b2b..b949a0dc 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/CallTimePassByReferenceSniff.php @@ -68,12 +68,8 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) // within their definitions. For example: function myFunction... // "myFunction" is T_STRING but we should skip because it is not a // function or method *call*. - // Also skip if the return value is being assigned to a variable. $prevCode = $tokens[$prev]['code']; - if ($prevCode === T_FUNCTION - || $prevCode === T_CLASS - || isset(PHP_CodeSniffer_Tokens::$assignmentTokens[$prevCode]) === true - ) { + if ($prevCode === T_FUNCTION || $prevCode === T_CLASS) { return; } @@ -98,11 +94,21 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $closeBracket = $tokens[$openBracket]['parenthesis_closer']; $nextSeparator = $openBracket; - while (($nextSeparator = $phpcsFile->findNext(T_VARIABLE, ($nextSeparator + 1), $closeBracket)) !== false) { + $find = array( + T_VARIABLE, + T_OPEN_SHORT_ARRAY, + ); + + while (($nextSeparator = $phpcsFile->findNext($find, ($nextSeparator + 1), $closeBracket)) !== false) { if (isset($tokens[$nextSeparator]['nested_parenthesis']) === false) { continue; } + if ($tokens[$nextSeparator]['code'] === T_OPEN_SHORT_ARRAY) { + $nextSeparator = $tokens[$nextSeparator]['bracket_closer']; + continue; + } + // Make sure the variable belongs directly to this function call // and is not inside a nested function call or array. $brackets = $tokens[$nextSeparator]['nested_parenthesis']; @@ -134,6 +140,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $tokenCode = $tokens[$tokenBefore]['code']; if ($tokenCode === T_VARIABLE || $tokenCode === T_CLOSE_PARENTHESIS + || $tokenCode === T_CLOSE_SQUARE_BRACKET || $tokenCode === T_LNUMBER || isset(PHP_CodeSniffer_Tokens::$assignmentTokens[$tokenCode]) === true ) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php index d05b1a10..e5acafa7 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/Functions/OpeningFunctionBraceKernighanRitchieSniff.php @@ -107,8 +107,9 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $error = 'Opening brace should be on the same line as the declaration'; $fix = $phpcsFile->addFixableError($error, $openingBrace, 'BraceOnNewLine'); if ($fix === true) { + $prev = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($openingBrace - 1), $closeBracket, true); $phpcsFile->fixer->beginChangeset(); - $phpcsFile->fixer->addContent($closeBracket, ' {'); + $phpcsFile->fixer->addContent($prev, ' {'); $phpcsFile->fixer->replaceToken($openingBrace, ''); $phpcsFile->fixer->endChangeset(); } diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/SyntaxSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/SyntaxSniff.php index 1bb0b826..407d514c 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/SyntaxSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/PHP/SyntaxSniff.php @@ -56,7 +56,12 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { $phpPath = PHP_CodeSniffer::getConfigData('php_path'); if ($phpPath === null) { - return; + // PHP_BINARY is available in PHP 5.4+. + if (defined('PHP_BINARY') === true) { + $phpPath = PHP_BINARY; + } else { + return; + } } $fileName = $phpcsFile->getFilename(); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php index 19c6eb8b..7359cc23 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowSpaceIndentSniff.php @@ -84,6 +84,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $checkTokens = array( T_WHITESPACE => true, + T_INLINE_HTML => true, T_DOC_COMMENT_WHITESPACE => true, ); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php index 57af8330..4d793239 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/DisallowTabIndentSniff.php @@ -71,6 +71,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $checkTokens = array( T_WHITESPACE => true, + T_INLINE_HTML => true, T_DOC_COMMENT_WHITESPACE => true, T_DOC_COMMENT_STRING => true, ); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php index 5a43dc2d..f7ddf2dd 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Generic/Sniffs/WhiteSpace/ScopeIndentSniff.php @@ -163,6 +163,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $lastCloseTag = null; $openScopes = array(); $adjustments = array(); + $setIndents = array(); $tokens = $phpcsFile->getTokens(); $first = $phpcsFile->findFirstOnLine(T_INLINE_HTML, $stackPtr); @@ -252,81 +253,146 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $parenOpener = $tokens[$parenCloser]['parenthesis_opener']; if ($tokens[$parenCloser]['line'] !== $tokens[$parenOpener]['line']) { - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $parenOpener, true); - $checkIndent = ($tokens[$first]['column'] - 1); - if (isset($adjustments[$first]) === true) { - $checkIndent += $adjustments[$first]; + $parens = 0; + if (isset($tokens[$parenCloser]['nested_parenthesis']) === true + && empty($tokens[$parenCloser]['nested_parenthesis']) === false + ) { + end($tokens[$parenCloser]['nested_parenthesis']); + $parens = key($tokens[$parenCloser]['nested_parenthesis']); + if ($this->_debug === true) { + $line = $tokens[$parens]['line']; + echo "\t* token has nested parenthesis $parens on line $line *".PHP_EOL; + } } - $exact = false; - - if ($this->_debug === true) { - $line = $tokens[$first]['line']; - $type = $tokens[$first]['type']; - echo "\t* first token on line $line is $type *".PHP_EOL; + $condition = 0; + if (isset($tokens[$parenCloser]['conditions']) === true + && empty($tokens[$parenCloser]['conditions']) === false + ) { + end($tokens[$parenCloser]['conditions']); + $condition = key($tokens[$parenCloser]['conditions']); + if ($this->_debug === true) { + $line = $tokens[$condition]['line']; + $type = $tokens[$condition]['type']; + echo "\t* token is inside condition $condition ($type) on line $line *".PHP_EOL; + } } - if ($first === $tokens[$parenCloser]['parenthesis_opener']) { - // This is unlikely to be the start of the statement, so look - // back further to find it. - $first--; + if ($parens > $condition) { + if ($this->_debug === true) { + echo "\t* using parenthesis *".PHP_EOL; + } + + $parenOpener = $parens; + $condition = 0; + } else if ($condition > 0) { + if ($this->_debug === true) { + echo "\t* using condition *".PHP_EOL; + } + + $parenOpener = $condition; + $parens = 0; } - $prev = $phpcsFile->findStartOfStatement($first); - if ($prev !== $first) { - // This is not the start of the statement. + $exact = false; + + if ($condition > 0 + && isset($tokens[$condition]['scope_opener']) === true + && isset($setIndents[$tokens[$condition]['scope_opener']]) === true + ) { + $checkIndent = $setIndents[$tokens[$condition]['scope_opener']]; + if (isset($adjustments[$condition]) === true) { + $checkIndent += $adjustments[$condition]; + } + + $currentIndent = $checkIndent; + if ($this->_debug === true) { - $line = $tokens[$prev]['line']; - $type = $tokens[$prev]['type']; - echo "\t* previous is $type on line $line *".PHP_EOL; + $type = $tokens[$condition]['type']; + echo "\t=> checking indent of $checkIndent; main indent set to $currentIndent by token $condition ($type)".PHP_EOL; + } + } else { + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $parenOpener, true); + + $checkIndent = ($tokens[$first]['column'] - 1); + if (isset($adjustments[$first]) === true) { + $checkIndent += $adjustments[$first]; } - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $prev, true); - $prev = $phpcsFile->findStartOfStatement($first); - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $prev, true); if ($this->_debug === true) { $line = $tokens[$first]['line']; $type = $tokens[$first]['type']; - echo "\t* amended first token is $type on line $line *".PHP_EOL; + echo "\t* first token on line $line is $first ($type) *".PHP_EOL; } - } - if (isset($tokens[$first]['scope_closer']) === true - && $tokens[$first]['scope_closer'] === $first - ) { - if ($this->_debug === true) { - echo "\t* first token is a scope closer *".PHP_EOL; + if ($first === $tokens[$parenCloser]['parenthesis_opener']) { + // This is unlikely to be the start of the statement, so look + // back further to find it. + $first--; } - if (isset($tokens[$first]['scope_condition']) === true) { - $scopeCloser = $first; - $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $tokens[$scopeCloser]['scope_condition'], true); + $prev = $phpcsFile->findStartOfStatement($first, T_COMMA); + if ($prev !== $first) { + // This is not the start of the statement. + if ($this->_debug === true) { + $line = $tokens[$prev]['line']; + $type = $tokens[$prev]['type']; + echo "\t* previous is $type on line $line *".PHP_EOL; + } + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $prev, true); + $prev = $phpcsFile->findStartOfStatement($first, T_COMMA); + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $prev, true); + if ($this->_debug === true) { + $line = $tokens[$first]['line']; + $type = $tokens[$first]['type']; + echo "\t* amended first token is $first ($type) on line $line *".PHP_EOL; + } + } + + if (isset($tokens[$first]['scope_closer']) === true + && $tokens[$first]['scope_closer'] === $first + ) { + if ($this->_debug === true) { + echo "\t* first token is a scope closer *".PHP_EOL; + } + + if (isset($tokens[$first]['scope_condition']) === true) { + $scopeCloser = $first; + $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $tokens[$scopeCloser]['scope_condition'], true); + + $currentIndent = ($tokens[$first]['column'] - 1); + if (isset($adjustments[$first]) === true) { + $currentIndent += $adjustments[$first]; + } + + // Make sure it is divisible by our expected indent. + if ($tokens[$tokens[$scopeCloser]['scope_condition']]['code'] !== T_CLOSURE) { + $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + } + + $setIndents[$first] = $currentIndent; + + if ($this->_debug === true) { + $type = $tokens[$first]['type']; + echo "\t=> indent set to $currentIndent by token $first ($type)".PHP_EOL; + } + }//end if + } else { + // Don't force current indent to divisible because there could be custom + // rules in place between parenthesis, such as with arrays. $currentIndent = ($tokens[$first]['column'] - 1); if (isset($adjustments[$first]) === true) { $currentIndent += $adjustments[$first]; } - // Make sure it is divisible by our expected indent. - if ($tokens[$tokens[$scopeCloser]['scope_condition']]['code'] !== T_CLOSURE) { - $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); - } + $setIndents[$first] = $currentIndent; if ($this->_debug === true) { - echo "\t=> indent set to $currentIndent".PHP_EOL; + $type = $tokens[$first]['type']; + echo "\t=> checking indent of $checkIndent; main indent set to $currentIndent by token $first ($type)".PHP_EOL; } }//end if - } else { - // Don't force current indent to divisible because there could be custom - // rules in place between parenthesis, such as with arrays. - $currentIndent = ($tokens[$first]['column'] - 1); - if (isset($adjustments[$first]) === true) { - $currentIndent += $adjustments[$first]; - } - - if ($this->_debug === true) { - echo "\t=> checking indent of $checkIndent; main indent set to $currentIndent".PHP_EOL; - } }//end if } else if ($this->_debug === true) { echo "\t * ignoring single-line definition *".PHP_EOL; @@ -363,7 +429,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) if ($this->_debug === true) { $line = $tokens[$first]['line']; $type = $tokens[$first]['type']; - echo "\t* first token on line $line is $type *".PHP_EOL; + echo "\t* first token on line $line is $first ($type) *".PHP_EOL; } if ($first === $tokens[$arrayCloser]['bracket_opener']) { @@ -372,7 +438,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $first--; } - $prev = $phpcsFile->findStartOfStatement($first); + $prev = $phpcsFile->findStartOfStatement($first, T_COMMA); if ($prev !== $first) { // This is not the start of the statement. if ($this->_debug === true) { @@ -382,12 +448,12 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $prev, true); - $prev = $phpcsFile->findStartOfStatement($first); + $prev = $phpcsFile->findStartOfStatement($first, T_COMMA); $first = $phpcsFile->findFirstOnLine(T_WHITESPACE, $prev, true); if ($this->_debug === true) { $line = $tokens[$first]['line']; $type = $tokens[$first]['type']; - echo "\t* amended first token is $type on line $line *".PHP_EOL; + echo "\t* amended first token is $first ($type) on line $line *".PHP_EOL; } } @@ -400,6 +466,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) if ($this->_debug === true) { echo "\t* first token is a scope closer; ignoring closing short array bracket *".PHP_EOL; } + + if (isset($setIndents[$first]) === true) { + $currentIndent = $setIndents[$first]; + if ($this->_debug === true) { + echo "\t=> indent reset to $currentIndent".PHP_EOL; + } + } } else { // Don't force current indent to be divisible because there could be custom // rules in place for arrays. @@ -408,10 +481,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $currentIndent += $adjustments[$first]; } + $setIndents[$first] = $currentIndent; + if ($this->_debug === true) { - echo "\t=> checking indent of $checkIndent; main indent set to $currentIndent".PHP_EOL; + $type = $tokens[$first]['type']; + echo "\t=> checking indent of $checkIndent; main indent set to $currentIndent by token $first ($type)".PHP_EOL; } - } + }//end if } else if ($this->_debug === true) { echo "\t * ignoring single-line definition *".PHP_EOL; }//end if @@ -520,8 +596,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); } + $setIndents[$scopeCloser] = $currentIndent; + if ($this->_debug === true) { - echo "\t=> indent set to $currentIndent".PHP_EOL; + $type = $tokens[$scopeCloser]['type']; + echo "\t=> indent set to $currentIndent by token $scopeCloser ($type)".PHP_EOL; } // We only check the indent of scope closers if they are @@ -624,11 +703,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } // Make sure it is divisible by our expected indent. - $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); - $checkIndent = (int) (ceil($checkIndent / $this->indent) * $this->indent); + $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $checkIndent = (int) (ceil($checkIndent / $this->indent) * $this->indent); + $setIndents[$first] = $currentIndent; if ($this->_debug === true) { - echo "\t=> checking indent of $checkIndent; main indent set to $currentIndent".PHP_EOL; + $type = $tokens[$first]['type']; + echo "\t=> checking indent of $checkIndent; main indent set to $currentIndent by token $first ($type)".PHP_EOL; } }//end if @@ -654,11 +735,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) && $tokens[$lastOpener]['level'] === $tokens[$checkToken]['level'] && $tokens[$lastOpener]['scope_closer'] === $tokens[$checkToken]['scope_closer'] ) { - $currentIndent -= $this->indent; + $currentIndent -= $this->indent; + $setIndents[$lastOpener] = $currentIndent; if ($this->_debug === true) { $line = $tokens[$i]['line']; + $type = $tokens[$lastOpener]['type']; echo "Shared closer found on line $line".PHP_EOL; - echo "\t=> indent set to $currentIndent".PHP_EOL; + echo "\t=> indent set to $currentIndent by token $lastOpener ($type)".PHP_EOL; } } @@ -772,6 +855,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) echo "\t=> Add adjustment of ".$adjustments[$checkToken]." for token $checkToken ($type) on line $line".PHP_EOL; } } + } else { + // Assume the change would be applied and continue + // checking indents under this assumption. This gives more + // technically accurate error messages. + $adjustments[$checkToken] = ($checkIndent - $tokenIndent); }//end if }//end if @@ -828,10 +916,12 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } // Make sure it is divisible by our expected indent. - $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $setIndents[$i] = $currentIndent; if ($this->_debug === true) { - echo "\t=> indent set to $currentIndent".PHP_EOL; + $type = $tokens[$i]['type']; + echo "\t=> indent set to $currentIndent by token $i ($type)".PHP_EOL; } continue; @@ -861,10 +951,12 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } // Make sure it is divisible by our expected indent. - $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $setIndents[$i] = $currentIndent; if ($this->_debug === true) { - echo "\t=> indent set to $currentIndent".PHP_EOL; + $type = $tokens[$i]['type']; + echo "\t=> indent set to $currentIndent by token $i ($type)".PHP_EOL; } continue; @@ -898,9 +990,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) // Make sure it is divisible by our expected indent. $currentIndent = (int) (floor($currentIndent / $this->indent) * $this->indent); $i = $tokens[$i]['scope_opener']; + $setIndents[$i] = $currentIndent; if ($this->_debug === true) { - echo "\t=> indent set to $currentIndent".PHP_EOL; + $type = $tokens[$i]['type']; + echo "\t=> indent set to $currentIndent by token $i ($type)".PHP_EOL; } continue; @@ -934,10 +1028,12 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } $currentIndent += $this->indent; + $setIndents[$i] = $currentIndent; $openScopes[$tokens[$i]['scope_closer']] = $tokens[$i]['scope_condition']; if ($this->_debug === true) { - echo "\t=> indent set to $currentIndent".PHP_EOL; + $type = $tokens[$i]['type']; + echo "\t=> indent set to $currentIndent by token $i ($type)".PHP_EOL; } continue; @@ -971,10 +1067,12 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } // Make sure it is divisible by our expected indent. - $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $setIndents[$first] = $currentIndent; if ($this->_debug === true) { - echo "\t=> indent set to $currentIndent".PHP_EOL; + $type = $tokens[$first]['type']; + echo "\t=> indent set to $currentIndent by token $first ($type)".PHP_EOL; } continue; @@ -1080,7 +1178,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) if ($this->_debug === true) { $line = $tokens[$first]['line']; $type = $tokens[$first]['type']; - echo "\t* first token on line $line is $type *".PHP_EOL; + echo "\t* first token on line $line is $first ($type) *".PHP_EOL; } $prev = $phpcsFile->findStartOfStatement($first); @@ -1096,7 +1194,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) if ($this->_debug === true) { $line = $tokens[$first]['line']; $type = $tokens[$first]['type']; - echo "\t* amended first token is $type on line $line *".PHP_EOL; + echo "\t* amended first token is $first ($type) on line $line *".PHP_EOL; } } @@ -1112,14 +1210,20 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) echo "\t* first token is a scope closer *".PHP_EOL; } - $currentIndent -= $this->indent; + if ($condition === 0 || $tokens[$condition]['scope_opener'] < $first) { + $currentIndent = $setIndents[$first]; + } else if ($this->_debug === true) { + echo "\t* ignoring scope closer *".PHP_EOL; + } } // Make sure it is divisible by our expected indent. - $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $currentIndent = (int) (ceil($currentIndent / $this->indent) * $this->indent); + $setIndents[$first] = $currentIndent; if ($this->_debug === true) { - echo "\t=> indent set to $currentIndent".PHP_EOL; + $type = $tokens[$first]['type']; + echo "\t=> indent set to $currentIndent by token $first ($type)".PHP_EOL; } }//end if }//end for diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php index 1a5fa068..2157d1a7 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/ClassCommentSniff.php @@ -71,29 +71,9 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing'); $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no'); return; - } else { - $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); } - // Try and determine if this is a file comment instead of a class comment. - // We assume that if this is the first comment after the open PHP tag, then - // it is most likely a file comment instead of a class comment. - if ($tokens[$commentEnd]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - $start = ($tokens[$commentEnd]['comment_opener'] - 1); - } else { - $start = $phpcsFile->findPrevious(T_COMMENT, ($commentEnd - 1), null, true); - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, $start, null, true); - if ($tokens[$prev]['code'] === T_OPEN_TAG) { - $prevOpen = $phpcsFile->findPrevious(T_OPEN_TAG, ($prev - 1)); - if ($prevOpen === false) { - // This is a comment directly after the first open tag, - // so probably a file comment. - $phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing'); - return; - } - } + $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); if ($tokens[$commentEnd]['code'] === T_COMMENT) { $phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongStyle'); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php index f4a48bc4..979c0da0 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Commenting/FileCommentSniff.php @@ -147,13 +147,47 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $phpcsFile->addError('Missing file doc comment', $errorToken, 'Missing'); $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); return ($phpcsFile->numTokens + 1); - } else { - $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); } - // Check the PHP Version, which should be in some text before the first tag. $commentEnd = $tokens[$commentStart]['comment_closer']; - $found = false; + + $nextToken = $phpcsFile->findNext( + T_WHITESPACE, + ($commentEnd + 1), + null, + true + ); + + $ignore = array( + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_FUNCTION, + T_CLOSURE, + T_PUBLIC, + T_PRIVATE, + T_PROTECTED, + T_FINAL, + T_STATIC, + T_ABSTRACT, + T_CONST, + T_PROPERTY, + T_INCLUDE, + T_INCLUDE_ONCE, + T_REQUIRE, + T_REQUIRE_ONCE, + ); + + if (in_array($tokens[$nextToken]['code'], $ignore) === true) { + $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); + return ($phpcsFile->numTokens + 1); + } + + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); + + // Check the PHP Version, which should be in some text before the first tag. + $found = false; for ($i = ($commentStart + 1); $i < $commentEnd; $i++) { if ($tokens[$i]['code'] === T_DOC_COMMENT_TAG) { break; diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php index ccd85c2c..2de5d96b 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/ControlStructures/MultiLineConditionSniff.php @@ -118,9 +118,9 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) // Each line between the parenthesis should be indented 4 spaces // and start with an operator, unless the line is inside a // function call, in which case it is ignored. - $lastLine = $tokens[$openBracket]['line']; + $prevLine = $tokens[$openBracket]['line']; for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { - if ($tokens[$i]['line'] !== $lastLine) { + if ($tokens[$i]['line'] !== $prevLine) { if ($tokens[$i]['line'] === $tokens[$closeBracket]['line']) { $next = $phpcsFile->findNext(T_WHITESPACE, $i, null, true); if ($next !== $closeBracket) { @@ -152,7 +152,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) }//end if if ($tokens[$i]['code'] === T_COMMENT) { - $lastLine = $tokens[$i]['line']; + $prevLine = $tokens[$i]['line']; continue; } @@ -181,8 +181,8 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } } - if ($tokens[$i]['line'] !== $tokens[$closeBracket]['line']) { - $next = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, $i, null, true); + $next = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, $i, null, true); + if ($next !== $closeBracket) { if (isset(PHP_CodeSniffer_Tokens::$booleanOperators[$tokens[$next]['code']]) === false) { $error = 'Each line in a multi-line IF statement must begin with a boolean operator'; $fix = $phpcsFile->addFixableError($error, $i, 'StartWithBoolean'); @@ -202,7 +202,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } }//end if - $lastLine = $tokens[$i]['line']; + $prevLine = $tokens[$i]['line']; }//end if if ($tokens[$i]['code'] === T_STRING) { @@ -211,7 +211,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) // This is a function call, so skip to the end as they // have their own indentation rules. $i = $tokens[$next]['parenthesis_closer']; - $lastLine = $tokens[$i]['line']; + $prevLine = $tokens[$i]['line']; continue; } } diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php index 4c3b0275..4c2c03a7 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionCallSignatureSniff.php @@ -165,7 +165,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) /** - * Processes single-line calls. + * Determine if this is a multi-line function call. * * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token @@ -353,11 +353,21 @@ public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, } // Each line between the parenthesis should be indented n spaces. - $lastLine = $tokens[$openBracket]['line']; + $lastLine = ($tokens[$openBracket]['line'] - 1); $argStart = null; $argEnd = null; $inArg = false; - for ($i = ($openBracket + 1); $i < $closeBracket; $i++) { + + // Start processing at the first argument. + $i = $phpcsFile->findNext(T_WHITESPACE, ($openBracket + 1), null, true); + if ($tokens[($i - 1)]['code'] === T_WHITESPACE + && $tokens[($i - 1)]['line'] === $tokens[$i]['line'] + ) { + // Make sure we check the indent. + $i--; + } + + for ($i; $i < $closeBracket; $i++) { if ($i > $argStart && $i < $argEnd) { $inArg = true; } else { @@ -384,76 +394,80 @@ public function processMultiLineCall(PHP_CodeSniffer_File $phpcsFile, $stackPtr, continue; } - // We changed lines, so this should be a whitespace indent token, but first make - // sure it isn't a blank line because we don't need to check indent unless there - // is actually some code to indent. - if ($tokens[$i]['code'] === T_WHITESPACE) { - $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closeBracket + 1), true); - if ($tokens[$nextCode]['line'] !== $lastLine) { - if ($inArg === false) { - $error = 'Empty lines are not allowed in multi-line function calls'; - $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); - if ($fix === true) { - $phpcsFile->fixer->replaceToken($i, ''); + if ($tokens[$i]['line'] !== $tokens[$openBracket]['line']) { + // We changed lines, so this should be a whitespace indent token, but first make + // sure it isn't a blank line because we don't need to check indent unless there + // is actually some code to indent. + if ($tokens[$i]['code'] === T_WHITESPACE) { + $nextCode = $phpcsFile->findNext(T_WHITESPACE, ($i + 1), ($closeBracket + 1), true); + if ($tokens[$nextCode]['line'] !== $lastLine) { + if ($inArg === false) { + $error = 'Empty lines are not allowed in multi-line function calls'; + $fix = $phpcsFile->addFixableError($error, $i, 'EmptyLine'); + if ($fix === true) { + $phpcsFile->fixer->replaceToken($i, ''); + } } - } - continue; + continue; + } + } else { + $nextCode = $i; } - } else { - $nextCode = $i; - } - if ($tokens[$nextCode]['line'] === $tokens[$closeBracket]['line']) { - // Closing brace needs to be indented to the same level - // as the function call. - $inArg = false; - $expectedIndent = $functionIndent; - } else { - $expectedIndent = ($functionIndent + $this->indent); - } + if ($tokens[$nextCode]['line'] === $tokens[$closeBracket]['line']) { + // Closing brace needs to be indented to the same level + // as the function call. + $inArg = false; + $expectedIndent = $functionIndent; + } else { + $expectedIndent = ($functionIndent + $this->indent); + } - if ($tokens[$i]['code'] !== T_WHITESPACE - && $tokens[$i]['code'] !== T_DOC_COMMENT_WHITESPACE - ) { - // Just check if it is a multi-line block comment. If so, we can - // calculate the indent from the whitespace before the content. - if ($tokens[$i]['code'] === T_COMMENT - && $tokens[($i - 1)]['code'] === T_COMMENT + if ($tokens[$i]['code'] !== T_WHITESPACE + && $tokens[$i]['code'] !== T_DOC_COMMENT_WHITESPACE ) { - $trimmed = ltrim($tokens[$i]['content']); - $foundIndent = (strlen($tokens[$i]['content']) - strlen($trimmed)); + // Just check if it is a multi-line block comment. If so, we can + // calculate the indent from the whitespace before the content. + if ($tokens[$i]['code'] === T_COMMENT + && $tokens[($i - 1)]['code'] === T_COMMENT + ) { + $trimmed = ltrim($tokens[$i]['content']); + $foundIndent = (strlen($tokens[$i]['content']) - strlen($trimmed)); + } else { + $foundIndent = 0; + } } else { - $foundIndent = 0; + $foundIndent = strlen($tokens[$i]['content']); } - } else { - $foundIndent = strlen($tokens[$i]['content']); - } - if ($foundIndent < $expectedIndent - || ($inArg === false - && $expectedIndent !== $foundIndent) - ) { - $error = 'Multi-line function call not indented correctly; expected %s spaces but found %s'; - $data = array( - $expectedIndent, - $foundIndent, - ); - - $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); - if ($fix === true) { - $padding = str_repeat(' ', $expectedIndent); - if ($foundIndent === 0) { - $phpcsFile->fixer->addContentBefore($i, $padding); - } else { - if ($tokens[$i]['code'] === T_COMMENT) { - $comment = $padding.ltrim($tokens[$i]['content']); - $phpcsFile->fixer->replaceToken($i, $comment); + if ($foundIndent < $expectedIndent + || ($inArg === false + && $expectedIndent !== $foundIndent) + ) { + $error = 'Multi-line function call not indented correctly; expected %s spaces but found %s'; + $data = array( + $expectedIndent, + $foundIndent, + ); + + $fix = $phpcsFile->addFixableError($error, $i, 'Indent', $data); + if ($fix === true) { + $padding = str_repeat(' ', $expectedIndent); + if ($foundIndent === 0) { + $phpcsFile->fixer->addContentBefore($i, $padding); } else { - $phpcsFile->fixer->replaceToken($i, $padding); + if ($tokens[$i]['code'] === T_COMMENT) { + $comment = $padding.ltrim($tokens[$i]['content']); + $phpcsFile->fixer->replaceToken($i, $comment); + } else { + $phpcsFile->fixer->replaceToken($i, $padding); + } } } - } + }//end if + } else { + $nextCode = $i; }//end if if ($inArg === false) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php index e28f6e95..c681257d 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PEAR/Sniffs/Functions/FunctionDeclarationSniff.php @@ -167,34 +167,54 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) }//end if }//end if - // Check if this is a single line or multi-line declaration. - $singleLine = true; - if ($tokens[$openBracket]['line'] === $tokens[$closeBracket]['line']) { - // Closures may use the USE keyword and so be multi-line in this way. - if ($tokens[$stackPtr]['code'] === T_CLOSURE) { - if ($use !== false) { - // If the opening and closing parenthesis of the use statement - // are also on the same line, this is a single line declaration. - $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); - $close = $tokens[$open]['parenthesis_closer']; - if ($tokens[$open]['line'] !== $tokens[$close]['line']) { - $singleLine = false; - } - } - } + if ($this->isMultiLineDeclaration($phpcsFile, $stackPtr, $openBracket, $tokens) === true) { + $this->processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); } else { - $singleLine = false; - } - - if ($singleLine === true) { $this->processSingleLineDeclaration($phpcsFile, $stackPtr, $tokens); - } else { - $this->processMultiLineDeclaration($phpcsFile, $stackPtr, $tokens); } }//end process() + /** + * Determine if this is a multi-line function declaration. + * + * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function isMultiLineDeclaration(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens) + { + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + if ($tokens[$openBracket]['line'] !== $tokens[$closeBracket]['line']) { + return true; + } + + // Closures may use the USE keyword and so be multi-line in this way. + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($closeBracket + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + // If the opening and closing parenthesis of the use statement + // are also on the same line, this is a single line declaration. + $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + $close = $tokens[$open]['parenthesis_closer']; + if ($tokens[$open]['line'] !== $tokens[$close]['line']) { + return true; + } + } + } + + return false; + + }//end isMultiLineDeclaration() + + /** * Processes single-line declarations. * diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php index dd283775..a41051f2 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR1/Sniffs/Files/SideEffectsSniff.php @@ -119,6 +119,11 @@ private function _searchForConflict(PHP_CodeSniffer_File $phpcsFile, $start, $en continue; } + // Ignore shebang. + if (substr($tokens[$i]['content'], 0, 2) === '#!') { + continue; + } + // Ignore entire namespace, declare, const and use statements. if ($tokens[$i]['code'] === T_NAMESPACE || $tokens[$i]['code'] === T_USE @@ -142,6 +147,12 @@ private function _searchForConflict(PHP_CodeSniffer_File $phpcsFile, $start, $en continue; } + // Ignore anon classes. + if ($tokens[$i]['code'] === T_ANON_CLASS) { + $i = $tokens[$i]['scope_closer']; + continue; + } + // Detect and skip over symbols. if (isset($symbols[$tokens[$i]['code']]) === true && isset($tokens[$i]['scope_closer']) === true diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php index 81d9c5cc..c219ba57 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Classes/ClassDeclarationSniff.php @@ -336,6 +336,7 @@ public function processOpen(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } else if ($tokens[($className - 1)]['code'] !== T_NS_SEPARATOR || $tokens[($className - 2)]['code'] !== T_STRING ) { + // Not part of a longer fully qualified class name. if ($tokens[($className - 1)]['code'] === T_COMMA || ($tokens[($className - 1)]['code'] === T_NS_SEPARATOR && $tokens[($className - 2)]['code'] === T_COMMA) @@ -369,7 +370,8 @@ public function processOpen(PHP_CodeSniffer_File $phpcsFile, $stackPtr) }//end if }//end if - if ($tokens[($className + 1)]['code'] !== T_NS_SEPARATOR + if ($checkingImplements === true + && $tokens[($className + 1)]['code'] !== T_NS_SEPARATOR && $tokens[($className + 1)]['code'] !== T_COMMA ) { if ($i !== ($classCount - 1)) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php new file mode 100644 index 00000000..8a4c188a --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/Methods/FunctionClosingBraceSniff.php @@ -0,0 +1,104 @@ + + * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @link http://pear.php.net/package/PHP_CodeSniffer + */ + +/** + * PSR2_Sniffs_Methods_FunctionClosingBraceSniff. + * + * Checks that the closing brace of a function goes directly after the body. + * + * @category PHP + * @package PHP_CodeSniffer + * @author Greg Sherwood + * @copyright 2006-2014 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/squizlabs/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + * @version Release: @package_version@ + * @link http://pear.php.net/package/PHP_CodeSniffer + */ +class PSR2_Sniffs_Methods_FunctionClosingBraceSniff implements PHP_CodeSniffer_Sniff +{ + + + /** + * Returns an array of tokens this test wants to listen for. + * + * @return array + */ + public function register() + { + return array( + T_FUNCTION, + T_CLOSURE, + ); + + }//end register() + + + /** + * Processes this test, when one of its tokens is encountered. + * + * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * + * @return void + */ + public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (isset($tokens[$stackPtr]['scope_closer']) === false) { + // Probably an interface method. + return; + } + + $closeBrace = $tokens[$stackPtr]['scope_closer']; + $prevContent = $phpcsFile->findPrevious(T_WHITESPACE, ($closeBrace - 1), null, true); + $found = ($tokens[$closeBrace]['line'] - $tokens[$prevContent]['line'] - 1); + + if ($found < 0) { + // Brace isn't on a new line, so not handled by us. + return; + } + + if ($found === 0) { + // All is good. + return; + } + + $error = 'Function closing brace must go on the next line following the body; found %s blank lines before brace'; + $data = array($found); + $fix = $phpcsFile->addFixableError($error, $closeBrace, 'SpacingBeforeClose', $data); + + if ($fix === true) { + $phpcsFile->fixer->beginChangeset(); + for ($i = ($prevContent + 1); $i < $closeBrace; $i++) { + if ($tokens[$i]['line'] === $tokens[$prevContent]['line']) { + continue; + } + + // Don't remove any identation before the brace. + if ($tokens[$i]['line'] === $tokens[$closeBrace]['line']) { + break; + } + + $phpcsFile->fixer->replaceToken($i, ''); + } + + $phpcsFile->fixer->endChangeset(); + } + + }//end process() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/ruleset.xml b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/ruleset.xml index e4127107..1bd543a4 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/ruleset.xml +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/ruleset.xml @@ -109,6 +109,7 @@ + @@ -155,6 +156,24 @@ The structure body MUST be indented once The closing brace MUST be on the next line after the body --> + + + + 0 + + + 0 + + + 0 + + + 0 + diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php index fb9b4b53..0a4b55fd 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayBracketSpacingSniff.php @@ -65,6 +65,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) if ($tokens[$stackPtr]['code'] === T_OPEN_SQUARE_BRACKET) { $openBracket = $stackPtr; } else { + if (isset($tokens[$stackPtr]['bracket_opener']) === false) { + return; + } + $openBracket = $tokens[$stackPtr]['bracket_opener']; } diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php index 7ae5cbfc..d759c413 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Arrays/ArrayDeclarationSniff.php @@ -120,11 +120,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $phpcsFile->fixer->endChangeset(); } - - // We can return here because there is nothing else to check. All code - // below can assume that the array is not empty. - return; } + + // We can return here because there is nothing else to check. All code + // below can assume that the array is not empty. + return; } if ($tokens[$arrayStart]['line'] === $tokens[$arrayEnd]['line']) { @@ -855,7 +855,7 @@ public function processMultiLineArray(PHP_CodeSniffer_File $phpcsFile, $stackPtr if ($fix === true) { // Find the end of the line and put a comma there. - for ($i = ($index['value'] + 1); $i < $phpcsFile->numTokens; $i++) { + for ($i = ($index['value'] + 1); $i < $arrayEnd; $i++) { if ($tokens[$i]['line'] > $valueLine) { break; } diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php index a428f3ff..02d6ae19 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionNameSpacingSniff.php @@ -76,8 +76,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) ); $endTokens += PHP_CodeSniffer_Tokens::$commentTokens; + $prev = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 1), null, true); + $foundContent = false; - $currentLine = $tokens[$stackPtr]['line']; + $currentLine = $tokens[$prev]['line']; for ($i = ($stackPtr - 1); $i >= 0; $i--) { if (isset($endTokens[$tokens[$i]['code']]) === true) { break; diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php index 1f7a09ed..ee889fd6 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/ClassDefinitionOpeningBraceSpaceSniff.php @@ -71,9 +71,13 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } else { $content = $tokens[($stackPtr - 1)]['content']; if ($content !== ' ') { - $length = strlen($content); - if ($length === 1) { - $length = 'tab'; + if ($tokens[($stackPtr - 1)]['line'] < $tokens[$stackPtr]['line']) { + $length = 'newline'; + } else { + $length = strlen($content); + if ($length === 1) { + $length = 'tab'; + } } $error = 'Expected 1 space before opening brace of class definition; %s found'; diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/IndentationSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/IndentationSniff.php index a1910253..27e3a4c1 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/IndentationSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/IndentationSniff.php @@ -103,7 +103,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } } - if ($tokens[$i]['column'] !== 1) { + if ($tokens[$i]['column'] !== 1 + || $tokens[$i]['code'] === T_OPEN_CURLY_BRACKET + || $tokens[$i]['code'] === T_CLOSE_CURLY_BRACKET + ) { continue; } diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/OpacitySniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/OpacitySniff.php index ec934a12..4f2a32c4 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/OpacitySniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/CSS/OpacitySniff.php @@ -83,7 +83,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } else { if (strlen($value) > 3) { $error = 'Opacity values must have a single value after the decimal point'; - $phpcsFile->addError($error, $next, 'SpacingAfterPoint'); + $phpcsFile->addError($error, $next, 'DecimalPrecision'); } else if ($value === '0.0' || $value === '1.0') { $error = 'Opacity value does not require decimal point; use %s instead'; $data = array($value{0}); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php index a57c4ce7..60f31d0b 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/BlockCommentSniff.php @@ -30,6 +30,13 @@ class Squiz_Sniffs_Commenting_BlockCommentSniff implements PHP_CodeSniffer_Sniff { + /** + * The --tab-width CLI value that is being used. + * + * @var int + */ + private $_tabWidth = null; + /** * Returns an array of tokens this test wants to listen for. @@ -57,6 +64,16 @@ public function register() */ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { + if ($this->_tabWidth === null) { + $cliValues = $phpcsFile->phpcs->cli->getCommandLineValues(); + if (isset($cliValues['tabWidth']) === false || $cliValues['tabWidth'] === 0) { + // We have no idea how wide tabs are, so assume 4 spaces for fixing. + $this->_tabWidth = 4; + } else { + $this->_tabWidth = $cliValues['tabWidth']; + } + } + $tokens = $phpcsFile->getTokens(); // If it's an inline comment, return. @@ -169,9 +186,18 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $error = 'Block comment text must start on a new line'; $fix = $phpcsFile->addFixableError($error, $stackPtr, 'NoNewLine'); if ($fix === true) { + $indent = ''; + if ($tokens[($stackPtr - 1)]['code'] === T_WHITESPACE) { + if (isset($tokens[($stackPtr - 1)]['orig_content']) === true) { + $indent = $tokens[($stackPtr - 1)]['orig_content']; + } else { + $indent = $tokens[($stackPtr - 1)]['content']; + } + } + $comment = preg_replace( '/^(\s*\/\*\*?)/', - '$1'.$phpcsFile->eolChar.' ', + '$1'.$phpcsFile->eolChar.$indent, $tokens[$stackPtr]['content'], 1 ); @@ -179,7 +205,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } return; - } + }//end if $starColumn = ($tokens[$stackPtr]['column'] + 3); @@ -209,10 +235,18 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $error = 'First line of comment not aligned correctly; expected %s but found %s'; $fix = $phpcsFile->addFixableError($error, $commentLines[1], 'FirstLineIndent', $data); if ($fix === true) { - $newContent = str_repeat(' ', $starColumn).ltrim($content); - $phpcsFile->fixer->replaceToken($commentLines[1], $newContent); + if (isset($tokens[$commentLines[1]]['orig_content']) === true + && $tokens[$commentLines[1]]['orig_content'][0] === "\t" + ) { + // Line is indented using tabs. + $padding = str_repeat("\t", floor($starColumn / $this->_tabWidth)); + } else { + $padding = str_repeat(' ', $starColumn); + } + + $phpcsFile->fixer->replaceToken($commentLines[1], $padding.ltrim($content)); } - } + }//end if if (preg_match('/^\p{Ll}/u', $commentText) === 1) { $error = 'Block comments must start with a capital letter'; @@ -252,10 +286,18 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $error = 'Comment line indented incorrectly; expected at least %s but found %s'; $fix = $phpcsFile->addFixableError($error, $line, 'LineIndent', $data); if ($fix === true) { - $newContent = str_repeat(' ', $starColumn).ltrim($tokens[$line]['content']); - $phpcsFile->fixer->replaceToken($line, $newContent); + if (isset($tokens[$line]['orig_content']) === true + && $tokens[$line]['orig_content'][0] === "\t" + ) { + // Line is indented using tabs. + $padding = str_repeat("\t", floor($starColumn / $this->_tabWidth)); + } else { + $padding = str_repeat(' ', $starColumn); + } + + $phpcsFile->fixer->replaceToken($line, $padding.ltrim($tokens[$line]['content'])); } - } + }//end if }//end foreach // Finally, test the last line is correct. diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php index 8c02bf42..9b2e9bc8 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/ClassCommentSniff.php @@ -68,28 +68,11 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) && $tokens[$commentEnd]['code'] !== T_COMMENT ) { $phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing'); + $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no'); return; } - // Try and determine if this is a file comment instead of a class comment. - // We assume that if this is the first comment after the open PHP tag, then - // it is most likely a file comment instead of a class comment. - if ($tokens[$commentEnd]['code'] === T_DOC_COMMENT_CLOSE_TAG) { - $start = ($tokens[$commentEnd]['comment_opener'] - 1); - } else { - $start = $phpcsFile->findPrevious(T_COMMENT, ($commentEnd - 1), null, true); - } - - $prev = $phpcsFile->findPrevious(T_WHITESPACE, $start, null, true); - if ($tokens[$prev]['code'] === T_OPEN_TAG) { - $prevOpen = $phpcsFile->findPrevious(T_OPEN_TAG, ($prev - 1)); - if ($prevOpen === false) { - // This is a comment directly after the first open tag, - // so probably a file comment. - $phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing'); - return; - } - } + $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes'); if ($tokens[$commentEnd]['code'] === T_COMMENT) { $phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongStyle'); @@ -102,11 +85,6 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } $commentStart = $tokens[$commentEnd]['comment_opener']; - if ($tokens[$prev]['line'] !== ($tokens[$commentStart]['line'] - 2)) { - $error = 'There must be exactly one blank line before the class comment'; - $phpcsFile->addError($error, $commentStart, 'SpacingBefore'); - } - foreach ($tokens[$commentStart]['comment_tags'] as $tag) { $error = '%s tag is not allowed in class comment'; $data = array($tokens[$tag]['content']); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php index 4aeb9186..d3c7f3d3 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FileCommentSniff.php @@ -70,14 +70,51 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) if ($tokens[$commentStart]['code'] === T_COMMENT) { $phpcsFile->addError('You must use "/**" style comments for a file comment', $commentStart, 'WrongStyle'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); return ($phpcsFile->numTokens + 1); } else if ($commentStart === false || $tokens[$commentStart]['code'] !== T_DOC_COMMENT_OPEN_TAG) { $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); return ($phpcsFile->numTokens + 1); } $commentEnd = $tokens[$commentStart]['comment_closer']; + $nextToken = $phpcsFile->findNext( + T_WHITESPACE, + ($commentEnd + 1), + null, + true + ); + + $ignore = array( + T_CLASS, + T_INTERFACE, + T_TRAIT, + T_FUNCTION, + T_CLOSURE, + T_PUBLIC, + T_PRIVATE, + T_PROTECTED, + T_FINAL, + T_STATIC, + T_ABSTRACT, + T_CONST, + T_PROPERTY, + T_INCLUDE, + T_INCLUDE_ONCE, + T_REQUIRE, + T_REQUIRE_ONCE, + ); + + if (in_array($tokens[$nextToken]['code'], $ignore) === true) { + $phpcsFile->addError('Missing file doc comment', $stackPtr, 'Missing'); + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'no'); + return ($phpcsFile->numTokens + 1); + } + + $phpcsFile->recordMetric($stackPtr, 'File has doc comment', 'yes'); + // No blank line between the open tag and the file comment. if ($tokens[$commentStart]['line'] > ($tokens[$stackPtr]['line'] + 1)) { $error = 'There must be no blank lines before the file comment'; diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php index 9cff6dd4..c1dc37c9 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentSniff.php @@ -97,9 +97,14 @@ protected function processReturn(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co } } + // Support both a return type and a description. The return type + // is anything up to the first space. + $returnParts = explode(' ', $content, 2); + $returnType = $returnParts[0]; + // If the return type is void, make sure there is // no return statement in the function. - if ($content === 'void') { + if ($returnType === 'void') { if (isset($tokens[$stackPtr]['scope_closer']) === true) { $endToken = $tokens[$stackPtr]['scope_closer']; for ($returnToken = $stackPtr; $returnToken < $endToken; $returnToken++) { @@ -125,7 +130,7 @@ protected function processReturn(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $co } } }//end if - } else if ($content !== 'mixed') { + } else if ($returnType !== 'mixed') { // If return type is not void, there needs to be a return statement // somewhere in the function that returns something. if (isset($tokens[$stackPtr]['scope_closer']) === true) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php index 23fa4cb6..98abfb8d 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/FunctionCommentThrowTagSniff.php @@ -73,14 +73,8 @@ protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $sta $commentEnd = $phpcsFile->findPrevious($find, ($currScope - 1), null, true); if ($tokens[$commentEnd]['code'] === T_COMMENT) { - // Inline comments might just be closing comments for - // control structures or functions instead of function comments - // using the wrong comment type. If there is other code on the line, - // assume they relate to that code. - $prev = $phpcsFile->findPrevious($find, ($commentEnd - 1), null, true); - if ($prev !== false && $tokens[$prev]['line'] === $tokens[$commentEnd]['line']) { - $commentEnd = $prev; - } + // Function is using the wrong type of comment. + return; } if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG @@ -90,17 +84,16 @@ protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $sta return; } - // Find the position where the current function scope ends. - $currScopeEnd = 0; - if (isset($tokens[$currScope]['scope_closer']) === true) { - $currScopeEnd = $tokens[$currScope]['scope_closer']; - } + $currScopeEnd = $tokens[$currScope]['scope_closer']; // Find all the exception type token within the current scope. $throwTokens = array(); $currPos = $stackPtr; - if ($currScopeEnd !== 0) { - while ($currPos < $currScopeEnd && $currPos !== false) { + $foundThrows = false; + while ($currPos < $currScopeEnd && $currPos !== false) { + if ($phpcsFile->hasCondition($currPos, T_CLOSURE) === false) { + $foundThrows = true; + /* If we can't find a NEW, we are probably throwing a variable, so we ignore it, but they still need to @@ -142,10 +135,14 @@ protected function processTokenWithinScope(PHP_CodeSniffer_File $phpcsFile, $sta } }//end if }//end if + }//end if - $currPos = $phpcsFile->findNext(T_THROW, ($currPos + 1), $currScopeEnd); - }//end while - }//end if + $currPos = $phpcsFile->findNext(T_THROW, ($currPos + 1), $currScopeEnd); + }//end while + + if ($foundThrows === false) { + return; + } // Only need one @throws tag for each type of exception thrown. $throwTokens = array_unique($throwTokens); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php index 6cf184cc..fb5710fc 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Commenting/InlineCommentSniff.php @@ -94,6 +94,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) T_ABSTRACT, T_CONST, T_PROPERTY, + T_INCLUDE, + T_INCLUDE_ONCE, + T_REQUIRE, + T_REQUIRE_ONCE, ); if (in_array($tokens[$nextToken]['code'], $ignore) === true) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php index ebc537cc..72f08073 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/ControlStructures/InlineIfDeclarationSniff.php @@ -89,7 +89,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) return; } - $spaceBefore = ($tokens[$stackPtr]['column'] - ($tokens[$contentBefore]['column'] + strlen($tokens[$contentBefore]['content']))); + $spaceBefore = ($tokens[$stackPtr]['column'] - ($tokens[$contentBefore]['column'] + $tokens[$contentBefore]['length'])); if ($spaceBefore !== 1) { $error = 'Inline shorthand IF statement requires 1 space before THEN; %s found'; $data = array($spaceBefore); @@ -108,7 +108,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $contentBefore = $phpcsFile->findPrevious(T_WHITESPACE, ($inlineElse - 1), null, true); $contentAfter = $phpcsFile->findNext(T_WHITESPACE, ($inlineElse + 1), null, true); - $spaceBefore = ($tokens[$inlineElse]['column'] - ($tokens[$contentBefore]['column'] + strlen($tokens[$contentBefore]['content']))); + $spaceBefore = ($tokens[$inlineElse]['column'] - ($tokens[$contentBefore]['column'] + $tokens[$contentBefore]['length'])); if ($spaceBefore !== 1) { $error = 'Inline shorthand IF statement requires 1 space before ELSE; %s found'; $data = array($spaceBefore); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php index d615b6e7..8d7eab98 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php @@ -215,56 +215,71 @@ public function processBracket(PHP_CodeSniffer_File $phpcsFile, $openBracket) // This is not the first argument in the function declaration. $arg = $tokens[$nextParam]['content']; + // Before we throw an error, make sure there is no type hint. + $comma = $phpcsFile->findPrevious(T_COMMA, ($nextParam - 1)); + $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($comma + 1), null, true); + if ($phpcsFile->isReference($nextToken) === true) { + $nextToken++; + } + + $gap = 0; if ($tokens[$whitespace]['code'] === T_WHITESPACE) { $gap = strlen($tokens[$whitespace]['content']); + } - // Before we throw an error, make sure there is no type hint. - $comma = $phpcsFile->findPrevious(T_COMMA, ($nextParam - 1)); - $nextToken = $phpcsFile->findNext(T_WHITESPACE, ($comma + 1), null, true); - if ($phpcsFile->isReference($nextToken) === true) { - $nextToken++; - } - - if ($nextToken !== $nextParam) { - // There was a type hint, so check the spacing between - // the hint and the variable as well. - $hint = $tokens[$nextToken]['content']; + if ($nextToken !== $nextParam) { + // There was a type hint, so check the spacing between + // the hint and the variable as well. + $hint = $tokens[$nextToken]['content']; - if ($gap !== 1) { - $error = 'Expected 1 space between type hint and argument "%s"; %s found'; - $data = array( - $arg, - $gap, - ); - $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpacingAfterHint', $data); - if ($fix === true) { + if ($gap !== 1) { + $error = 'Expected 1 space between type hint and argument "%s"; %s found'; + $data = array( + $arg, + $gap, + ); + $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpacingAfterHint', $data); + if ($fix === true) { + if ($gap === 0) { + $phpcsFile->fixer->addContent($whitespace, ' '); + } else { $phpcsFile->fixer->replaceToken($whitespace, ' '); } } + } - if ($multiLine === false) { - if ($tokens[($comma + 1)]['code'] !== T_WHITESPACE) { - $error = 'Expected 1 space between comma and type hint "%s"; 0 found'; - $data = array($hint); - $fix = $phpcsFile->addFixableError($error, $nextToken, 'NoSpaceBeforeHint', $data); + if ($multiLine === false) { + if ($tokens[($comma + 1)]['code'] !== T_WHITESPACE) { + $error = 'Expected 1 space between comma and type hint "%s"; 0 found'; + $data = array($hint); + $fix = $phpcsFile->addFixableError($error, $nextToken, 'NoSpaceBeforeHint', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($comma, ' '); + } + } else { + $gap = strlen($tokens[($comma + 1)]['content']); + if ($gap !== 1) { + $error = 'Expected 1 space between comma and type hint "%s"; %s found'; + $data = array( + $hint, + $gap, + ); + $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpacingBeforeHint', $data); if ($fix === true) { - $phpcsFile->fixer->addContent($comma, ' '); - } - } else { - $gap = strlen($tokens[($comma + 1)]['content']); - if ($gap !== 1) { - $error = 'Expected 1 space between comma and type hint "%s"; %s found'; - $data = array( - $hint, - $gap, - ); - $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpacingBeforeHint', $data); - if ($fix === true) { - $phpcsFile->fixer->replaceToken(($comma + 1), ' '); - } + $phpcsFile->fixer->replaceToken(($comma + 1), ' '); } - }//end if + } }//end if + }//end if + } else { + // No type hint. + if ($gap === 0) { + $error = 'Expected 1 space between comma and argument "%s"; 0 found'; + $data = array($arg); + $fix = $phpcsFile->addFixableError($error, $nextToken, 'NoSpaceBeforeArg', $data); + if ($fix === true) { + $phpcsFile->fixer->addContent($whitespace, ' '); + } } else if ($gap !== 1) { // Just make sure this is not actually an indent. if ($tokens[$whitespace]['line'] === $tokens[($whitespace - 1)]['line']) { @@ -280,13 +295,6 @@ public function processBracket(PHP_CodeSniffer_File $phpcsFile, $openBracket) } } }//end if - } else { - $error = 'Expected 1 space between comma and argument "%s"; 0 found'; - $data = array($arg); - $fix = $phpcsFile->addFixableError($error, $nextToken, 'NoSpaceBeforeArg', $data); - if ($fix === true) { - $phpcsFile->fixer->addContent($whitespace, ' '); - } }//end if } else { $gap = 0; @@ -303,7 +311,7 @@ public function processBracket(PHP_CodeSniffer_File $phpcsFile, $openBracket) $nextToken++; } - if ($nextToken !== $nextParam) { + if ($tokens[$nextToken]['code'] !== T_ELLIPSIS && $nextToken !== $nextParam) { // There was a type hint, so check the spacing between // the hint and the variable as well. $hint = $tokens[$nextToken]['content']; @@ -316,7 +324,11 @@ public function processBracket(PHP_CodeSniffer_File $phpcsFile, $openBracket) ); $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpacingAfterHint', $data); if ($fix === true) { - $phpcsFile->fixer->replaceToken(($nextToken + 1), ' '); + if ($gap === 0) { + $phpcsFile->fixer->addContent($nextToken, ' '); + } else { + $phpcsFile->fixer->replaceToken(($nextToken + 1), ' '); + } } } @@ -335,7 +347,7 @@ public function processBracket(PHP_CodeSniffer_File $phpcsFile, $openBracket) $fix = $phpcsFile->addFixableError($error, $nextToken, 'SpacingAfterOpenHint', $data); if ($fix === true) { $padding = str_repeat(' ', $this->requiredSpacesAfterOpen); - if ($gap === 0) { + if ($spaceAfterOpen === 0) { $phpcsFile->fixer->addContent($openBracket, $padding); } else { $phpcsFile->fixer->replaceToken(($openBracket + 1), $padding); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php index 2958d90b..f2d1e7f9 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Functions/MultiLineFunctionDeclarationSniff.php @@ -44,6 +44,73 @@ class Squiz_Sniffs_Functions_MultiLineFunctionDeclarationSniff extends PEAR_Snif ); + /** + * Determine if this is a multi-line function declaration. + * + * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the current token + * in the stack passed in $tokens. + * @param int $openBracket The position of the opening bracket + * in the stack passed in $tokens. + * @param array $tokens The stack of tokens that make up + * the file. + * + * @return void + */ + public function isMultiLineDeclaration(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $openBracket, $tokens) + { + $bracketsToCheck = array($stackPtr => $openBracket); + + // Closures may use the USE keyword and so be multi-line in this way. + if ($tokens[$stackPtr]['code'] === T_CLOSURE) { + $use = $phpcsFile->findNext(T_USE, ($tokens[$openBracket]['parenthesis_closer'] + 1), $tokens[$stackPtr]['scope_opener']); + if ($use !== false) { + $open = $phpcsFile->findNext(T_OPEN_PARENTHESIS, ($use + 1)); + if ($open !== false) { + $bracketsToCheck[$use] = $open; + } + } + } + + foreach ($bracketsToCheck as $stackPtr => $openBracket) { + // If the first argument is on a new line, this is a multi-line + // function declaration, even if there is only one argument. + $next = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($openBracket + 1), null, true); + if ($tokens[$next]['line'] !== $tokens[$stackPtr]['line']) { + return true; + } + + $closeBracket = $tokens[$openBracket]['parenthesis_closer']; + + $end = $phpcsFile->findEndOfStatement($openBracket + 1); + while ($tokens[$end]['code'] === T_COMMA) { + // If the next bit of code is not on the same line, this is a + // multi-line function declaration. + $next = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($end + 1), $closeBracket, true); + if ($next === false) { + continue(2); + } + + if ($tokens[$next]['line'] !== $tokens[$end]['line']) { + return true; + } + + $end = $phpcsFile->findEndOfStatement($next); + } + + // We've reached the last argument, so see if the next content + // (should be the close bracket) is also on the same line. + $next = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($end + 1), $closeBracket, true); + if ($next !== false && $tokens[$next]['line'] !== $tokens[$end]['line']) { + return true; + } + }//end foreach + + return false; + + }//end isMultiLineDeclaration() + + /** * Processes multi-line declarations. * diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php index 452959ca..90001b89 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/Operators/ComparisonOperatorUsageSniff.php @@ -184,6 +184,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $requiredOps = 0; $foundOps = 0; + $foundBools = 0; for ($i = $start; $i <= $end; $i++) { $type = $tokens[$i]['code']; @@ -199,36 +200,42 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $foundOps++; } - if ($phpcsFile->tokenizerType !== 'JS') { - if ($tokens[$i]['code'] === T_BOOLEAN_AND || $tokens[$i]['code'] === T_BOOLEAN_OR) { - $requiredOps++; + if ($tokens[$i]['code'] === T_TRUE || $tokens[$i]['code'] === T_FALSE) { + $foundBools++; + } - // When the instanceof operator is used with another operator - // like ===, you can get more ops than are required. - if ($foundOps > $requiredOps) { - $foundOps = $requiredOps; - } + if ($phpcsFile->tokenizerType !== 'JS' + && ($tokens[$i]['code'] === T_BOOLEAN_AND + || $tokens[$i]['code'] === T_BOOLEAN_OR) + ) { + $requiredOps++; - // If we get to here and we have not found the right number of - // comparison operators, then we must have had an implicit - // true operation ie. if ($a) instead of the required - // if ($a === true), so let's add an error. - if ($requiredOps !== $foundOps) { - $error = 'Implicit true comparisons prohibited; use === TRUE instead'; - $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); - $foundOps++; - } + // When the instanceof operator is used with another operator + // like ===, you can get more ops than are required. + if ($foundOps > $requiredOps) { + $foundOps = $requiredOps; } - }//end if + + // If we get to here and we have not found the right number of + // comparison operators, then we must have had an implicit + // true operation i.e., if ($a) instead of the required + // if ($a === true), so let's add an error. + if ($requiredOps !== $foundOps) { + $error = 'Implicit true comparisons prohibited; use === TRUE instead'; + $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); + $foundOps++; + } + } }//end for $requiredOps++; - if ($phpcsFile->tokenizerType !== 'JS') { - if ($foundOps < $requiredOps) { - $error = 'Implicit true comparisons prohibited; use === TRUE instead'; - $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); - } + if ($phpcsFile->tokenizerType !== 'JS' + && $foundOps < $requiredOps + && ($requiredOps !== $foundBools) + ) { + $error = 'Implicit true comparisons prohibited; use === TRUE instead'; + $phpcsFile->addError($error, $stackPtr, 'ImplicitTrue'); } }//end process() diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php index 980d999f..7601a2c5 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/InnerFunctionsSniff.php @@ -56,17 +56,27 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) { $tokens = $phpcsFile->getTokens(); - if ($phpcsFile->hasCondition($stackPtr, T_FUNCTION) === true) { - $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_EQUAL) { - // Ignore closures. - return; - } + $function = $phpcsFile->getCondition($stackPtr, T_FUNCTION); + if ($function === false) { + // Not a nested function. + return; + } + + $class = $phpcsFile->getCondition($stackPtr, T_ANON_CLASS); + if ($class !== false && $class > $function) { + // Ignore methods in anon classes. + return; + } - $error = 'The use of inner functions is forbidden'; - $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); + $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); + if ($tokens[$prev]['code'] === T_EQUAL) { + // Ignore closures. + return; } + $error = 'The use of inner functions is forbidden'; + $phpcsFile->addError($error, $stackPtr, 'NotAllowed'); + }//end process() diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php index 57d4b197..ed9106d7 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/LowercasePHPFunctionsSniff.php @@ -30,6 +30,25 @@ class Squiz_Sniffs_PHP_LowercasePHPFunctionsSniff implements PHP_CodeSniffer_Sniff { + /** + * String -> int hash map of all php built in function names + * + * @var array + */ + private $_builtInFunctions; + + + /** + * Construct the LowercasePHPFunctionSniff + */ + public function __construct() + { + + $allFunctions = get_defined_functions(); + $this->_builtInFunctions = array_flip($allFunctions['internal']); + + }//end __construct() + /** * Returns an array of tokens this test wants to listen for. @@ -95,11 +114,10 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) } // Make sure it is an inbuilt PHP function. - // PHP_CodeSniffer doesn't include/require any files, so no - // user defined global functions can exist, except for - // PHP_CodeSniffer ones. + // PHP_CodeSniffer can possibly include user defined functions + // through the use of vendor/autoload.php. $content = $tokens[$stackPtr]['content']; - if (function_exists($content) === false) { + if (isset($this->_builtInFunctions[strtolower($content)]) === false) { return; } diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php index e05887ef..8b44e481 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/PHP/NonExecutableCodeSniff.php @@ -66,7 +66,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) // If this token is preceded with an "or", it only relates to one line // and should be ignored. For example: fopen() or die(). $prev = $phpcsFile->findPrevious(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr - 1), null, true); - if ($tokens[$prev]['code'] === T_LOGICAL_OR) { + if ($tokens[$prev]['code'] === T_LOGICAL_OR || $tokens[$prev]['code'] === T_BOOLEAN_OR) { return; } @@ -111,19 +111,19 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $owner = $tokens[$stackPtr]['scope_condition']; if ($tokens[$owner]['code'] === T_CASE || $tokens[$owner]['code'] === T_DEFAULT) { // This token closes the scope of a CASE or DEFAULT statement - // so any code between this token and the next CASE, DEFAULT or + // so any code between this statement and the next CASE, DEFAULT or // end of SWITCH token will not be executable. + $end = $phpcsFile->findEndOfStatement($stackPtr); $next = $phpcsFile->findNext( array( T_CASE, T_DEFAULT, T_CLOSE_CURLY_BRACKET, ), - ($stackPtr + 1) + ($end + 1) ); if ($next !== false) { - $end = $phpcsFile->findNext(array(T_SEMICOLON), ($stackPtr + 1)); $lastLine = $tokens[$end]['line']; for ($i = ($stackPtr + 1); $i < $next; $i++) { if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$tokens[$i]['code']]) === true) { diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php index a41bd5c5..f5cc07c1 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php @@ -63,6 +63,12 @@ protected function processMemberVar(PHP_CodeSniffer_File $phpcsFile, $stackPtr) $fix = $phpcsFile->addFixableError($error, $prev, 'AfterComment', $data); if ($fix === true) { $phpcsFile->fixer->beginChangeset(); + // Inline comments have the newline included in the content but + // docblock do not. + if ($tokens[$prev]['code'] === T_COMMENT) { + $phpcsFile->fixer->replaceToken($prev, rtrim($tokens[$prev]['content'])); + } + for ($i = ($prev + 1); $i <= $stackPtr; $i++) { if ($tokens[$i]['line'] === $tokens[$stackPtr]['line']) { break; diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php index c962aad1..ec64e5e8 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php @@ -187,7 +187,7 @@ public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) return; }//end if - if ($tokens[$stackPtr]['code'] === T_MINUS) { + if ($tokens[$stackPtr]['code'] === T_MINUS || $tokens[$stackPtr]['code'] === T_PLUS) { // Check minus spacing, but make sure we aren't just assigning // a minus value or returning one. $prev = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/CSS.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/CSS.php index 6b67e447..a92b02b6 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/CSS.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/CSS.php @@ -30,6 +30,13 @@ class PHP_CodeSniffer_Tokenizers_CSS extends PHP_CodeSniffer_Tokenizers_PHP { + /** + * If TRUE, files that appear to be minified will not be processed. + * + * @var boolean + */ + public $skipMinified = true; + /** * Creates an array of tokens when given some CSS code. diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/Comment.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/Comment.php index a54ca133..5df17810 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/Comment.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/Comment.php @@ -108,7 +108,6 @@ public function tokenizeString($string, $eolChar, $stackPtr) $stackPtr++; if (PHP_CODESNIFFER_VERBOSITY > 1) { $content = PHP_CodeSniffer::prepareForOutput($space['content']); - $type = $lineToken['type']; echo "\t\tCreate comment token: T_DOC_COMMENT_WHITESPACE => $content".PHP_EOL; } diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/JS.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/JS.php index e7890cdd..302fe46f 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/JS.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/JS.php @@ -27,6 +27,13 @@ class PHP_CodeSniffer_Tokenizers_JS { + /** + * If TRUE, files that appear to be minified will not be processed. + * + * @var boolean + */ + public $skipMinified = true; + /** * A list of tokens that are allowed to open a scope. * @@ -814,16 +821,15 @@ public function tokenizeString($string, $eolChar='\n') if ($newContent !== '' && $newContent !== '.') { $finalTokens[($newStackPtr - 1)]['content'] = $newContent; if (ctype_digit($newContent) === true) { - $finalTokens[($newStackPtr - 1)]['code'] - = constant('T_LNUMBER'); + $finalTokens[($newStackPtr - 1)]['code'] = constant('T_LNUMBER'); $finalTokens[($newStackPtr - 1)]['type'] = 'T_LNUMBER'; } else { - $finalTokens[($newStackPtr - 1)]['code'] - = constant('T_DNUMBER'); + $finalTokens[($newStackPtr - 1)]['code'] = constant('T_DNUMBER'); $finalTokens[($newStackPtr - 1)]['type'] = 'T_DNUMBER'; } $stackPtr--; + continue; } else { $stackPtr = $oldStackPtr; } @@ -885,6 +891,8 @@ public function getRegexToken($char, $string, $chars, $tokens, $eolChar) T_COMMA => true, T_COLON => true, T_TYPEOF => true, + T_INLINE_THEN => true, + T_INLINE_ELSE => true, ); $afterTokens = array( @@ -894,6 +902,7 @@ public function getRegexToken($char, $string, $chars, $tokens, $eolChar) ';' => true, ' ' => true, '.' => true, + ':' => true, $eolChar => true, ); diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/PHP.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/PHP.php index b96adeb0..0a9ddd6c 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/PHP.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokenizers/PHP.php @@ -26,6 +26,13 @@ class PHP_CodeSniffer_Tokenizers_PHP { + /** + * If TRUE, files that appear to be minified will not be processed. + * + * @var boolean + */ + public $skipMinified = false; + /** * A list of tokens that are allowed to open a scope. * @@ -324,6 +331,7 @@ public function tokenizeString($string, $eolChar='\n') $lastNotEmptyToken = 0; $insideInlineIf = array(); + $insideUseGroup = false; $commentTokenizer = new PHP_CodeSniffer_Tokenizers_Comment(); @@ -500,8 +508,6 @@ public function tokenizeString($string, $eolChar='\n') $nowdoc = true; } - $newStackPtr++; - $tokenContent = ''; for ($i = ($stackPtr + 1); $i < $numTokens; $i++) { $subTokenIsArray = is_array($tokens[$i]); @@ -519,7 +525,24 @@ public function tokenizeString($string, $eolChar='\n') } } + if ($i === $numTokens) { + // We got to the end of the file and never + // found the closing token, so this probably wasn't + // a heredoc. + if (PHP_CODESNIFFER_VERBOSITY > 1) { + $type = $finalTokens[$newStackPtr]['type']; + echo "\t\t* failed to find the end of the here/nowdoc".PHP_EOL; + echo "\t\t* token $stackPtr changed from $type to T_STRING".PHP_EOL; + } + + $finalTokens[$newStackPtr]['code'] = T_STRING; + $finalTokens[$newStackPtr]['type'] = 'T_STRING'; + $newStackPtr++; + continue; + } + $stackPtr = $i; + $newStackPtr++; // Convert each line within the heredoc to a // new token, so it conforms with other multiple line tokens. @@ -610,6 +633,51 @@ public function tokenizeString($string, $eolChar='\n') continue; } + /* + Before PHP 5.6, the **= operator was tokenized as + T_MULTIPLY followed by T_MUL_EQUAL. So look for and combine + these tokens in earlier versions. + */ + + if ($tokenIsArray === false + && $token[0] === '*' + && isset($tokens[($stackPtr + 1)]) === true + && is_array($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][1] === '*=' + ) { + $newToken = array(); + $newToken['code'] = T_POW_EQUAL; + $newToken['type'] = 'T_POW_EQUAL'; + $newToken['content'] = '**='; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr++; + continue; + } + + /* + Before PHP 7, the ?? operator was tokenized as + T_INLINE_THEN followed by T_INLINE_THEN. + So look for and combine these tokens in earlier versions. + */ + + if ($tokenIsArray === false + && $token[0] === '?' + && isset($tokens[($stackPtr + 1)]) === true + && $tokens[($stackPtr + 1)][0] === '?' + ) { + $newToken = array(); + $newToken['code'] = T_COALESCE; + $newToken['type'] = 'T_COALESCE'; + $newToken['content'] = '??'; + $finalTokens[$newStackPtr] = $newToken; + + $newStackPtr++; + $stackPtr++; + continue; + } + /* Before PHP 7, the <=> operator was tokenized as T_IS_SMALLER_OR_EQUAL followed by T_GREATER_THAN. @@ -665,6 +733,7 @@ public function tokenizeString($string, $eolChar='\n') if ($tokenIsArray === true && $token[0] === T_STRING + && isset($tokens[($stackPtr + 1)]) === true && $tokens[($stackPtr + 1)] === ':' && $tokens[($stackPtr - 1)][0] !== T_PAAMAYIM_NEKUDOTAYIM ) { @@ -895,6 +964,23 @@ public function tokenizeString($string, $eolChar='\n') $newToken['type'] = 'T_STRING'; } + // This is a special case for use groups in PHP 7+ where leaving + // the curly braces as their normal tokens would confuse + // the scope map and sniffs. + if ($newToken['code'] === T_OPEN_CURLY_BRACKET + && $finalTokens[$lastNotEmptyToken]['code'] === T_NS_SEPARATOR + ) { + $newToken['code'] = T_OPEN_USE_GROUP; + $newToken['type'] = 'T_OPEN_USE_GROUP'; + $insideUseGroup = true; + } + + if ($insideUseGroup === true && $newToken['code'] === T_CLOSE_CURLY_BRACKET) { + $newToken['code'] = T_CLOSE_USE_GROUP; + $newToken['type'] = 'T_CLOSE_USE_GROUP'; + $insideUseGroup = false; + } + $finalTokens[$newStackPtr] = $newToken; $newStackPtr++; }//end if @@ -941,13 +1027,19 @@ public function processAdditional(&$tokens, $eolChar) if ($tokens[$i]['code'] === T_FUNCTION) { // Context sensitive keywords support. - for ($x = ($i + 1); $i < $numTokens; $x++) { + for ($x = ($i + 1); $x < $numTokens; $x++) { if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$tokens[$x]['code']]) === false) { // Non-whitespace content. break; } } + if ($x === $numTokens) { + // We got to the end without finding any more + // non-whitespace content. + continue; + } + if (in_array($tokens[$x]['code'], array(T_STRING, T_OPEN_PARENTHESIS, T_BITWISE_AND), true) === false) { if (PHP_CODESNIFFER_VERBOSITY > 1) { $line = $tokens[$x]['line']; @@ -996,12 +1088,18 @@ public function processAdditional(&$tokens, $eolChar) $tokenAfterReturnTypeHint = $tokens[$i]['scope_opener']; } else if (isset($tokens[$i]['parenthesis_closer']) === true) { - for ($x = ($tokens[$i]['parenthesis_closer'] + 1); $i < $numTokens; $x++) { + $tokenAfterReturnTypeHint = null; + for ($x = ($tokens[$i]['parenthesis_closer'] + 1); $x < $numTokens; $x++) { if ($tokens[$x]['code'] === T_SEMICOLON) { $tokenAfterReturnTypeHint = $x; break; } } + + if ($tokenAfterReturnTypeHint === null) { + // Probably a syntax error. + continue; + } } else { // Probably a syntax error. continue; @@ -1014,7 +1112,7 @@ public function processAdditional(&$tokens, $eolChar) for ($x = ($tokenAfterReturnTypeHint - 1); $x > $i; $x--) { if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$tokens[$x]['code']]) === false) { - if ($tokens[$x]['code'] === T_STRING || $tokens[$x]['code'] === T_ARRAY) { + if (in_array($tokens[$x]['code'], array(T_STRING, T_ARRAY, T_CALLABLE, T_SELF, T_PARENT), true) === true) { if (PHP_CODESNIFFER_VERBOSITY > 1) { $line = $tokens[$x]['line']; $type = $tokens[$x]['type']; @@ -1043,6 +1141,8 @@ public function processAdditional(&$tokens, $eolChar) if ($tokens[$x]['code'] === T_OPEN_PARENTHESIS || $tokens[$x]['code'] === T_OPEN_CURLY_BRACKET + || $tokens[$x]['code'] === T_EXTENDS + || $tokens[$x]['code'] === T_IMPLEMENTS ) { $tokens[$i]['code'] = T_ANON_CLASS; $tokens[$i]['type'] = 'T_ANON_CLASS'; @@ -1215,11 +1315,11 @@ public function processAdditional(&$tokens, $eolChar) } } - if ($tokens[$x]['code'] === T_CASE) { + if ($tokens[$x]['code'] === T_CASE || $tokens[$x]['code'] === T_DEFAULT) { // Special case for multiple CASE statements that share the same // closer. Because we are going backwards through the file, this next - // CASE statement is already fixed, so just use its closer and don't - // worry about fixing anything. + // CASE/DEFAULT statement is already fixed, so just use its closer + // and don't worry about fixing anything. $newCloser = $tokens[$x]['scope_closer']; $tokens[$i]['scope_closer'] = $newCloser; if (PHP_CODESNIFFER_VERBOSITY > 1) { @@ -1235,7 +1335,7 @@ public function processAdditional(&$tokens, $eolChar) if ($tokens[$x]['code'] !== T_OPEN_CURLY_BRACKET || isset($tokens[$x]['scope_condition']) === true ) { - // Not a CASE with a curly brace opener. + // Not a CASE/DEFAULT with a curly brace opener. continue; } diff --git a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokens.php b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokens.php index d53d69d3..b112c0b2 100644 --- a/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokens.php +++ b/vendor/squizlabs/php_codesniffer/CodeSniffer/Tokens.php @@ -73,6 +73,8 @@ define('T_BINARY_CAST', 'PHPCS_T_BINARY_CAST'); define('T_EMBEDDED_PHP', 'PHPCS_T_EMBEDDED_PHP'); define('T_RETURN_TYPE', 'PHPCS_T_RETURN_TYPE'); +define('T_OPEN_USE_GROUP', 'PHPCS_T_OPEN_USE_GROUP'); +define('T_CLOSE_USE_GROUP', 'PHPCS_T_CLOSE_USE_GROUP'); // Some PHP 5.3 tokens, replicated for lower versions. if (defined('T_NAMESPACE') === false) { @@ -130,11 +132,19 @@ define('T_POW', 'PHPCS_T_POW'); } +if (defined('T_POW_EQUAL') === false) { + define('T_POW_EQUAL', 'PHPCS_T_POW_EQUAL'); +} + // Some PHP 7 tokens, replicated for lower versions. if (defined('T_SPACESHIP') === false) { define('T_SPACESHIP', 'PHPCS_T_SPACESHIP'); } +if (defined('T_COALESCE') === false) { + define('T_COALESCE', 'PHPCS_T_COALESCE'); +} + // Tokens used for parsing doc blocks. define('T_DOC_COMMENT_STAR', 'PHPCS_T_DOC_COMMENT_STAR'); define('T_DOC_COMMENT_WHITESPACE', 'PHPCS_T_DOC_COMMENT_WHITESPACE'); @@ -209,6 +219,7 @@ final class PHP_CodeSniffer_Tokens T_MODULUS => 5, T_POW => 5, T_SPACESHIP => 5, + T_COALESCE => 5, T_SL => 5, T_SR => 5, @@ -317,6 +328,7 @@ final class PHP_CodeSniffer_Tokens T_LOGICAL_XOR => 3, T_METHOD_C => 10, T_MINUS_EQUAL => 2, + T_POW_EQUAL => 3, T_MOD_EQUAL => 2, T_MUL_EQUAL => 2, T_NAMESPACE => 9, @@ -368,6 +380,7 @@ final class PHP_CodeSniffer_Tokens T_MODULUS => 1, T_POW => 2, T_SPACESHIP => 3, + T_COALESCE => 2, T_BITWISE_AND => 1, T_BITWISE_OR => 1, T_BITWISE_XOR => 1, @@ -397,9 +410,11 @@ final class PHP_CodeSniffer_Tokens public static $assignmentTokens = array( T_EQUAL => T_EQUAL, T_AND_EQUAL => T_AND_EQUAL, + T_OR_EQUAL => T_OR_EQUAL, T_CONCAT_EQUAL => T_CONCAT_EQUAL, T_DIV_EQUAL => T_DIV_EQUAL, T_MINUS_EQUAL => T_MINUS_EQUAL, + T_POW_EQUAL => T_POW_EQUAL, T_MOD_EQUAL => T_MOD_EQUAL, T_MUL_EQUAL => T_MUL_EQUAL, T_PLUS_EQUAL => T_PLUS_EQUAL, @@ -493,29 +508,30 @@ final class PHP_CodeSniffer_Tokens * @var array(int) */ public static $scopeOpeners = array( - T_CLASS => T_CLASS, - T_INTERFACE => T_INTERFACE, - T_TRAIT => T_TRAIT, - T_NAMESPACE => T_NAMESPACE, - T_FUNCTION => T_FUNCTION, - T_CLOSURE => T_CLOSURE, - T_IF => T_IF, - T_SWITCH => T_SWITCH, - T_CASE => T_CASE, - T_DECLARE => T_DECLARE, - T_DEFAULT => T_DEFAULT, - T_WHILE => T_WHILE, - T_ELSE => T_ELSE, - T_ELSEIF => T_ELSEIF, - T_FOR => T_FOR, - T_FOREACH => T_FOREACH, - T_DO => T_DO, - T_TRY => T_TRY, - T_CATCH => T_CATCH, - T_FINALLY => T_FINALLY, - T_PROPERTY => T_PROPERTY, - T_OBJECT => T_OBJECT, - T_USE => T_USE, + T_CLASS => T_CLASS, + T_ANON_CLASS => T_ANON_CLASS, + T_INTERFACE => T_INTERFACE, + T_TRAIT => T_TRAIT, + T_NAMESPACE => T_NAMESPACE, + T_FUNCTION => T_FUNCTION, + T_CLOSURE => T_CLOSURE, + T_IF => T_IF, + T_SWITCH => T_SWITCH, + T_CASE => T_CASE, + T_DECLARE => T_DECLARE, + T_DEFAULT => T_DEFAULT, + T_WHILE => T_WHILE, + T_ELSE => T_ELSE, + T_ELSEIF => T_ELSEIF, + T_FOR => T_FOR, + T_FOREACH => T_FOREACH, + T_DO => T_DO, + T_TRY => T_TRY, + T_CATCH => T_CATCH, + T_FINALLY => T_FINALLY, + T_PROPERTY => T_PROPERTY, + T_OBJECT => T_OBJECT, + T_USE => T_USE, ); /** @@ -556,6 +572,7 @@ final class PHP_CodeSniffer_Tokens T_MODULUS => T_MODULUS, T_POW => T_POW, T_SPACESHIP => T_SPACESHIP, + T_COALESCE => T_COALESCE, T_BITWISE_AND => T_BITWISE_AND, T_BITWISE_OR => T_BITWISE_OR, T_BITWISE_XOR => T_BITWISE_XOR, diff --git a/vendor/squizlabs/php_codesniffer/README.md b/vendor/squizlabs/php_codesniffer/README.md index 0cb82ae1..3123ee1a 100644 --- a/vendor/squizlabs/php_codesniffer/README.md +++ b/vendor/squizlabs/php_codesniffer/README.md @@ -50,9 +50,9 @@ You will then be able to run PHP_CodeSniffer from the vendor bin directory: ./vendor/bin/phpcs -h ./vendor/bin/phpcbf -h -You can also download the PHP\_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git checkout: +You can also download the PHP\_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone: - git clone git://github.com/squizlabs/PHP_CodeSniffer.git + git clone https://github.com/squizlabs/PHP_CodeSniffer.git cd PHP_CodeSniffer php scripts/phpcs -h php scripts/phpcbf -h diff --git a/vendor/squizlabs/php_codesniffer/composer.json b/vendor/squizlabs/php_codesniffer/composer.json index 0dff7923..9199c1ad 100644 --- a/vendor/squizlabs/php_codesniffer/composer.json +++ b/vendor/squizlabs/php_codesniffer/composer.json @@ -54,7 +54,8 @@ "require": { "php": ">=5.1.2", "ext-tokenizer": "*", - "ext-xmlwriter": "*" + "ext-xmlwriter": "*", + "ext-simplexml": "*" }, "require-dev": { "phpunit/phpunit": "~4.0" diff --git a/vendor/squizlabs/php_codesniffer/phpcs.xml.dist b/vendor/squizlabs/php_codesniffer/phpcs.xml.dist index 8c35a7d3..85b313e0 100644 --- a/vendor/squizlabs/php_codesniffer/phpcs.xml.dist +++ b/vendor/squizlabs/php_codesniffer/phpcs.xml.dist @@ -8,7 +8,6 @@ */Tests/* - diff --git a/vendor/symfony/yaml/Dumper.php b/vendor/symfony/yaml/Dumper.php index 39cdcfc5..05817f5d 100644 --- a/vendor/symfony/yaml/Dumper.php +++ b/vendor/symfony/yaml/Dumper.php @@ -28,10 +28,14 @@ class Dumper /** * Sets the indentation. * - * @param int $num The amount of spaces to use for indentation of nested nodes. + * @param int $num The amount of spaces to use for indentation of nested nodes */ public function setIndentation($num) { + if ($num < 1) { + throw new \InvalidArgumentException('The indentation must be greater than zero.'); + } + $this->indentation = (int) $num; } @@ -54,7 +58,7 @@ public function dump($input, $inline = 0, $indent = 0, $exceptionOnInvalidType = if ($inline <= 0 || !is_array($input) || empty($input)) { $output .= $prefix.Inline::dump($input, $exceptionOnInvalidType, $objectSupport); } else { - $isAHash = array_keys($input) !== range(0, count($input) - 1); + $isAHash = Inline::isHash($input); foreach ($input as $key => $value) { $willBeInlined = $inline - 1 <= 0 || !is_array($value) || empty($value); diff --git a/vendor/symfony/yaml/Escaper.php b/vendor/symfony/yaml/Escaper.php index 7bac8dde..a74f14dd 100644 --- a/vendor/symfony/yaml/Escaper.php +++ b/vendor/symfony/yaml/Escaper.php @@ -46,7 +46,7 @@ class Escaper * * @param string $value A PHP value * - * @return bool True if the value would require double quotes. + * @return bool True if the value would require double quotes */ public static function requiresDoubleQuoting($value) { @@ -70,7 +70,7 @@ public static function escapeWithDoubleQuotes($value) * * @param string $value A PHP value * - * @return bool True if the value would require single quotes. + * @return bool True if the value would require single quotes */ public static function requiresSingleQuoting($value) { diff --git a/vendor/symfony/yaml/Inline.php b/vendor/symfony/yaml/Inline.php index bb2db360..717cbfd5 100644 --- a/vendor/symfony/yaml/Inline.php +++ b/vendor/symfony/yaml/Inline.php @@ -157,6 +157,28 @@ public static function dump($value, $exceptionOnInvalidType = false, $objectSupp } } + /** + * Check if given array is hash or just normal indexed array. + * + * @internal + * + * @param array $value The PHP array to check + * + * @return bool true if value is hash array, false otherwise + */ + public static function isHash(array $value) + { + $expectedKey = 0; + + foreach ($value as $key => $val) { + if ($key !== $expectedKey++) { + return true; + } + } + + return false; + } + /** * Dumps a PHP array to a YAML string. * @@ -169,11 +191,7 @@ public static function dump($value, $exceptionOnInvalidType = false, $objectSupp private static function dumpArray($value, $exceptionOnInvalidType, $objectSupport) { // array - $keys = array_keys($value); - $keysCount = count($keys); - if ((1 === $keysCount && '0' == $keys[0]) - || ($keysCount > 1 && array_reduce($keys, function ($v, $w) { return (int) $v + $w; }, 0) === $keysCount * ($keysCount - 1) / 2) - ) { + if ($value && !self::isHash($value)) { $output = array(); foreach ($value as $val) { $output[] = self::dump($val, $exceptionOnInvalidType, $objectSupport); @@ -182,7 +200,7 @@ private static function dumpArray($value, $exceptionOnInvalidType, $objectSuppor return sprintf('[%s]', implode(', ', $output)); } - // mapping + // hash $output = array(); foreach ($value as $key => $val) { $output[] = sprintf('%s: %s', self::dump($key, $exceptionOnInvalidType, $objectSupport), self::dump($val, $exceptionOnInvalidType, $objectSupport)); diff --git a/vendor/symfony/yaml/Parser.php b/vendor/symfony/yaml/Parser.php index 41134e6b..7cdb9643 100644 --- a/vendor/symfony/yaml/Parser.php +++ b/vendor/symfony/yaml/Parser.php @@ -25,19 +25,26 @@ class Parser const FOLDED_SCALAR_PATTERN = self::BLOCK_SCALAR_HEADER_PATTERN; private $offset = 0; + private $totalNumberOfLines; private $lines = array(); private $currentLineNb = -1; private $currentLine = ''; private $refs = array(); + private $skippedLineNumbers = array(); + private $locallySkippedLineNumbers = array(); /** * Constructor. * - * @param int $offset The offset of YAML document (used for line numbers in error messages) + * @param int $offset The offset of YAML document (used for line numbers in error messages) + * @param int|null $totalNumberOfLines The overall number of lines being parsed + * @param int[] $skippedLineNumbers Number of comment lines that have been skipped by the parser */ - public function __construct($offset = 0) + public function __construct($offset = 0, $totalNumberOfLines = null, array $skippedLineNumbers = array()) { $this->offset = $offset; + $this->totalNumberOfLines = $totalNumberOfLines; + $this->skippedLineNumbers = $skippedLineNumbers; } /** @@ -62,6 +69,10 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = $value = $this->cleanup($value); $this->lines = explode("\n", $value); + if (null === $this->totalNumberOfLines) { + $this->totalNumberOfLines = count($this->lines); + } + if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) { $mbEncoding = mb_internal_encoding(); mb_internal_encoding('UTF-8'); @@ -83,7 +94,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = $isRef = $mergeNode = false; if (preg_match('#^\-((?P\s+)(?P.+?))?\s*$#u', $this->currentLine, $values)) { if ($context && 'mapping' == $context) { - throw new ParseException('You cannot define a sequence item when in a mapping'); + throw new ParseException('You cannot define a sequence item when in a mapping', $this->getRealCurrentLineNb() + 1, $this->currentLine); } $context = 'sequence'; @@ -94,25 +105,18 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = // array if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { - $c = $this->getRealCurrentLineNb() + 1; - $parser = new self($c); - $parser->refs = &$this->refs; - $data[] = $parser->parse($this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); + $data[] = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(null, true), $exceptionOnInvalidType, $objectSupport, $objectForMap); } else { if (isset($values['leadspaces']) && preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P.+?))?\s*$#u', $values['value'], $matches) ) { // this is a compact notation element, add to next block and parse - $c = $this->getRealCurrentLineNb(); - $parser = new self($c); - $parser->refs = &$this->refs; - $block = $values['value']; if ($this->isNextLineIndented()) { $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + strlen($values['leadspaces']) + 1); } - $data[] = $parser->parse($block, $exceptionOnInvalidType, $objectSupport, $objectForMap); + $data[] = $this->parseBlock($this->getRealCurrentLineNb(), $block, $exceptionOnInvalidType, $objectSupport, $objectForMap); } else { $data[] = $this->parseValue($values['value'], $exceptionOnInvalidType, $objectSupport, $objectForMap, $context); } @@ -122,7 +126,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = } } elseif (preg_match('#^(?P'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P.+?))?\s*$#u', $this->currentLine, $values) && (false === strpos($values['key'], ' #') || in_array($values['key'][0], array('"', "'")))) { if ($context && 'sequence' == $context) { - throw new ParseException('You cannot define a mapping item when in a sequence'); + throw new ParseException('You cannot define a mapping item when in a sequence', $this->currentLineNb + 1, $this->currentLine); } $context = 'mapping'; @@ -168,10 +172,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = } else { $value = $this->getNextEmbedBlock(); } - $c = $this->getRealCurrentLineNb() + 1; - $parser = new self($c); - $parser->refs = &$this->refs; - $parsed = $parser->parse($value, $exceptionOnInvalidType, $objectSupport, $objectForMap); + $parsed = $this->parseBlock($this->getRealCurrentLineNb() + 1, $value, $exceptionOnInvalidType, $objectSupport, $objectForMap); if (!is_array($parsed)) { throw new ParseException('YAML merge keys used with a scalar value instead of an array.', $this->getRealCurrentLineNb() + 1, $this->currentLine); @@ -219,10 +220,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = $data[$key] = null; } } else { - $c = $this->getRealCurrentLineNb() + 1; - $parser = new self($c); - $parser->refs = &$this->refs; - $value = $parser->parse($this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap); + $value = $this->parseBlock($this->getRealCurrentLineNb() + 1, $this->getNextEmbedBlock(), $exceptionOnInvalidType, $objectSupport, $objectForMap); // Spec: Keys MUST be unique; first one wins. // But overwriting is allowed when a merge node is used in current block. if ($allowOverwrite || !isset($data[$key])) { @@ -243,7 +241,7 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = } else { // multiple documents are not supported if ('---' === $this->currentLine) { - throw new ParseException('Multiple documents are not supported.'); + throw new ParseException('Multiple documents are not supported.', $this->currentLineNb + 1, $this->currentLine); } // 1-liner optionally followed by newline(s) @@ -316,6 +314,24 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = return empty($data) ? null : $data; } + private function parseBlock($offset, $yaml, $exceptionOnInvalidType, $objectSupport, $objectForMap) + { + $skippedLineNumbers = $this->skippedLineNumbers; + + foreach ($this->locallySkippedLineNumbers as $lineNumber) { + if ($lineNumber < $offset) { + continue; + } + + $skippedLineNumbers[] = $lineNumber; + } + + $parser = new self($offset, $this->totalNumberOfLines, $skippedLineNumbers); + $parser->refs = &$this->refs; + + return $parser->parse($yaml, $exceptionOnInvalidType, $objectSupport, $objectForMap); + } + /** * Returns the current line number (takes the offset into account). * @@ -323,7 +339,17 @@ public function parse($value, $exceptionOnInvalidType = false, $objectSupport = */ private function getRealCurrentLineNb() { - return $this->currentLineNb + $this->offset; + $realCurrentLineNumber = $this->currentLineNb + $this->offset; + + foreach ($this->skippedLineNumbers as $skippedLineNumber) { + if ($skippedLineNumber > $realCurrentLineNumber) { + break; + } + + ++$realCurrentLineNumber; + } + + return $realCurrentLineNumber; } /** @@ -426,6 +452,14 @@ private function getNextEmbedBlock($indentation = null, $inSequence = false) // we ignore "comment" lines only when we are not inside a scalar block if (empty($blockScalarIndentations) && $this->isCurrentLineComment()) { + // remember ignored comment lines (they are used later in nested + // parser calls to determine real line numbers) + // + // CAUTION: beware to not populate the global property here as it + // will otherwise influence the getRealCurrentLineNb() call here + // for consecutive comment lines and subsequent embedded blocks + $this->locallySkippedLineNumbers[] = $this->getRealCurrentLineNb(); + continue; } @@ -461,10 +495,18 @@ private function moveToNextLine() /** * Moves the parser to the previous line. + * + * @return bool */ private function moveToPreviousLine() { + if ($this->currentLineNb < 1) { + return false; + } + $this->currentLine = $this->lines[--$this->currentLineNb]; + + return true; } /** @@ -490,7 +532,7 @@ private function parseValue($value, $exceptionOnInvalidType, $objectSupport, $ob } if (!array_key_exists($value, $this->refs)) { - throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLine); + throw new ParseException(sprintf('Reference "%s" does not exist.', $value), $this->currentLineNb + 1, $this->currentLine); } return $this->refs[$value]; @@ -585,6 +627,8 @@ private function parseBlockScalar($style, $chomping = '', $indentation = 0) if ($notEOF) { $blockLines[] = ''; $this->moveToPreviousLine(); + } elseif (!$notEOF && !$this->isCurrentLineLastLineInDocument()) { + $blockLines[] = ''; } // folded style @@ -691,6 +735,11 @@ private function isCurrentLineComment() return '' !== $ltrimmedLine && $ltrimmedLine[0] === '#'; } + private function isCurrentLineLastLineInDocument() + { + return ($this->offset + $this->currentLineNb) >= ($this->totalNumberOfLines - 1); + } + /** * Cleanups a YAML string to be parsed. * @@ -768,7 +817,7 @@ private function isNextLineUnIndentedCollection() */ private function isStringUnIndentedCollectionItem() { - return 0 === strpos($this->currentLine, '- '); + return '-' === rtrim($this->currentLine) || 0 === strpos($this->currentLine, '- '); } /** diff --git a/vendor/symfony/yaml/README.md b/vendor/symfony/yaml/README.md index 85a97867..0d324881 100644 --- a/vendor/symfony/yaml/README.md +++ b/vendor/symfony/yaml/README.md @@ -1,21 +1,13 @@ Yaml Component ============== -YAML implements most of the YAML 1.2 specification. - -```php -use Symfony\Component\Yaml\Yaml; - -$array = Yaml::parse(file_get_contents(filename)); - -print Yaml::dump($array); -``` +The Yaml component loads and dumps YAML files. Resources --------- -You can run the unit tests with the following command: - - $ cd path/to/Symfony/Component/Yaml/ - $ composer install - $ phpunit + * [Documentation](https://symfony.com/doc/current/components/yaml/index.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/yaml/Tests/DumperTest.php b/vendor/symfony/yaml/Tests/DumperTest.php index 2a0df692..84069d8a 100644 --- a/vendor/symfony/yaml/Tests/DumperTest.php +++ b/vendor/symfony/yaml/Tests/DumperTest.php @@ -228,6 +228,24 @@ public function getEscapeSequences() 'paragraph-separator' => array("\t\\P", '"\t\\\\P"'), ); } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage The indentation must be greater than zero + */ + public function testZeroIndentationThrowsException() + { + $this->dumper->setIndentation(0); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage The indentation must be greater than zero + */ + public function testNegativeIndentationThrowsException() + { + $this->dumper->setIndentation(-4); + } } class A diff --git a/vendor/symfony/yaml/Tests/InlineTest.php b/vendor/symfony/yaml/Tests/InlineTest.php index f0f9b96b..e349bfcc 100644 --- a/vendor/symfony/yaml/Tests/InlineTest.php +++ b/vendor/symfony/yaml/Tests/InlineTest.php @@ -220,6 +220,24 @@ public function getScalarIndicators() return array(array('|'), array('>')); } + /** + * @dataProvider getDataForIsHash + */ + public function testIsHash($array, $expected) + { + $this->assertSame($expected, Inline::isHash($array)); + } + + public function getDataForIsHash() + { + return array( + array(array(), false), + array(array(1, 2, 3), false), + array(array(2 => 1, 1 => 2, 0 => 3), true), + array(array('foo' => 1, 'bar' => 2), true), + ); + } + public function getTestsForParse() { return array( @@ -426,6 +444,8 @@ public function getTestsForDump() array('[foo, { bar: foo, foo: [foo, { bar: foo }] }, [foo, { bar: foo }]]', array('foo', array('bar' => 'foo', 'foo' => array('foo', array('bar' => 'foo'))), array('foo', array('bar' => 'foo')))), array('[foo, \'@foo.baz\', { \'%foo%\': \'foo is %foo%\', bar: \'%foo%\' }, true, \'@service_container\']', array('foo', '@foo.baz', array('%foo%' => 'foo is %foo%', 'bar' => '%foo%'), true, '@service_container')), + + array('{ foo: { bar: { 1: 2, baz: 3 } } }', array('foo' => array('bar' => array(1 => 2, 'baz' => 3)))), ); } } diff --git a/vendor/symfony/yaml/Tests/ParserTest.php b/vendor/symfony/yaml/Tests/ParserTest.php index d41c583e..9e9a715a 100644 --- a/vendor/symfony/yaml/Tests/ParserTest.php +++ b/vendor/symfony/yaml/Tests/ParserTest.php @@ -11,6 +11,7 @@ namespace Symfony\Component\Yaml\Tests; +use Symfony\Bridge\PhpUnit\ErrorAssert; use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Parser; @@ -596,7 +597,7 @@ public function testShortcutKeyUnindentedCollectionException() /** * @expectedException \Symfony\Component\Yaml\Exception\ParseException - * @expectedExceptionMessage Multiple documents are not supported. + * @expectedExceptionMessageRegExp /^Multiple documents are not supported.+/ */ public function testMultipleDocumentsNotSupportedException() { @@ -628,6 +629,53 @@ public function testSequenceInAMapping() ); } + public function testSequenceInMappingStartedBySingleDashLine() + { + $yaml = << array( + array( + 'b' => array( + array( + 'bar' => 'baz', + ), + ), + ), + 'foo', + ), + 'd' => 'e', + ); + + $this->assertSame($expected, $this->parser->parse($yaml)); + } + + public function testSequenceFollowedByCommentEmbeddedInMapping() + { + $yaml = << array( + 'b' => array('c'), + 'd' => 'e', + ), + ); + + $this->assertSame($expected, $this->parser->parse($yaml)); + } + /** * @expectedException \Symfony\Component\Yaml\Exception\ParseException */ @@ -880,26 +928,18 @@ public function testFloatKeys() /** * @group legacy * throw ParseException in Symfony 3.0 + * @requires function Symfony\Bridge\PhpUnit\ErrorAssert::assertDeprecationsAreTriggered */ public function testColonInMappingValueException() { - $yaml = <<parser; + + ErrorAssert::assertDeprecationsAreTriggered('Using a colon in the unquoted mapping value "bar: baz" in line 1 is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.', function () use ($parser) { + $yaml = <<parse($yaml); }); - - $this->parser->parse($yaml); - - restore_error_handler(); - - $this->assertCount(1, $deprecations); - $this->assertContains('Using a colon in the unquoted mapping value "bar: baz" in line 1 is deprecated since Symfony 2.8 and will throw a ParseException in 3.0.', $deprecations[0]); } public function testColonInMappingValueExceptionNotTriggeredByColonInComment() @@ -989,6 +1029,7 @@ public function getCommentLikeStringInScalarBlockData() foo # bar baz + EOT , ), @@ -1017,7 +1058,7 @@ public function getCommentLikeStringInScalarBlockData() $expected = array( 'foo' => array( 'bar' => array( - 'scalar-block' => 'line1 line2>', + 'scalar-block' => "line1 line2>\n", ), 'baz' => array( 'foobar' => null, @@ -1095,6 +1136,74 @@ public function testAdditionallyIndentedLinesAreParsedAsNewLinesInFoldedBlocks() $this->parser->parse($yaml) ); } + + /** + * @param $lineNumber + * @param $yaml + * @dataProvider parserThrowsExceptionWithCorrectLineNumberProvider + */ + public function testParserThrowsExceptionWithCorrectLineNumber($lineNumber, $yaml) + { + $this->setExpectedException( + '\Symfony\Component\Yaml\Exception\ParseException', + sprintf('Unexpected characters near "," at line %d (near "bar: "123",").', $lineNumber) + ); + + $this->parser->parse($yaml); + } + + public function parserThrowsExceptionWithCorrectLineNumberProvider() + { + return array( + array( + 4, + <<assertEquals($parsedByFilename, $parsedByContents); } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage The indentation must be greater than zero + */ + public function testZeroIndentationThrowsException() + { + Yaml::dump(array('lorem' => 'ipsum', 'dolor' => 'sit'), 2, 0); + } + + /** + * @expectedException \InvalidArgumentException + * @expectedExceptionMessage The indentation must be greater than zero + */ + public function testNegativeIndentationThrowsException() + { + Yaml::dump(array('lorem' => 'ipsum', 'dolor' => 'sit'), 2, -4); + } } diff --git a/vendor/symfony/yaml/Unescaper.php b/vendor/symfony/yaml/Unescaper.php index bb330161..1e02cc9f 100644 --- a/vendor/symfony/yaml/Unescaper.php +++ b/vendor/symfony/yaml/Unescaper.php @@ -39,9 +39,9 @@ class Unescaper /** * Unescapes a single quoted string. * - * @param string $value A single quoted string. + * @param string $value A single quoted string * - * @return string The unescaped string. + * @return string The unescaped string */ public function unescapeSingleQuotedString($value) { @@ -51,9 +51,9 @@ public function unescapeSingleQuotedString($value) /** * Unescapes a double quoted string. * - * @param string $value A double quoted string. + * @param string $value A double quoted string * - * @return string The unescaped string. + * @return string The unescaped string */ public function unescapeDoubleQuotedString($value) { diff --git a/vendor/symfony/yaml/Yaml.php b/vendor/symfony/yaml/Yaml.php index be05a365..6fc4e927 100644 --- a/vendor/symfony/yaml/Yaml.php +++ b/vendor/symfony/yaml/Yaml.php @@ -73,24 +73,28 @@ public static function parse($input, $exceptionOnInvalidType = false, $objectSup } /** - * Dumps a PHP array to a YAML string. + * Dumps a PHP value to a YAML string. * * The dump method, when supplied with an array, will do its best * to convert the array into friendly YAML. * - * @param array $array PHP array + * @param mixed $input The PHP value * @param int $inline The level where you switch to inline YAML - * @param int $indent The amount of spaces to use for indentation of nested nodes. + * @param int $indent The amount of spaces to use for indentation of nested nodes * @param bool $exceptionOnInvalidType true if an exception must be thrown on invalid types (a PHP resource or object), false otherwise * @param bool $objectSupport true if object support is enabled, false otherwise * - * @return string A YAML string representing the original PHP array + * @return string A YAML string representing the original PHP value */ - public static function dump($array, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false) + public static function dump($input, $inline = 2, $indent = 4, $exceptionOnInvalidType = false, $objectSupport = false) { + if ($indent < 1) { + throw new \InvalidArgumentException('The indentation must be greater than zero.'); + } + $yaml = new Dumper(); $yaml->setIndentation($indent); - return $yaml->dump($array, $inline, 0, $exceptionOnInvalidType, $objectSupport); + return $yaml->dump($input, $inline, 0, $exceptionOnInvalidType, $objectSupport); } } diff --git a/vendor/webmozart/assert/.composer-auth.json b/vendor/webmozart/assert/.composer-auth.json new file mode 100644 index 00000000..eea80018 --- /dev/null +++ b/vendor/webmozart/assert/.composer-auth.json @@ -0,0 +1,7 @@ +{ + "github-oauth": { + "github.com": "PLEASE DO NOT USE THIS TOKEN IN YOUR OWN PROJECTS/FORKS", + "github.com": "This token is reserved for testing the webmozart/* repositories", + "github.com": "a9debbffdd953ee9b3b82dbc3b807cde2086bb86" + } +} diff --git a/vendor/webmozart/assert/.gitignore b/vendor/webmozart/assert/.gitignore new file mode 100644 index 00000000..3a9875b4 --- /dev/null +++ b/vendor/webmozart/assert/.gitignore @@ -0,0 +1,2 @@ +/vendor/ +composer.lock diff --git a/vendor/webmozart/assert/.styleci.yml b/vendor/webmozart/assert/.styleci.yml new file mode 100644 index 00000000..bb3a52d8 --- /dev/null +++ b/vendor/webmozart/assert/.styleci.yml @@ -0,0 +1,7 @@ +preset: symfony + +enabled: + - ordered_use + +disabled: + - empty_return diff --git a/vendor/webmozart/assert/.travis.yml b/vendor/webmozart/assert/.travis.yml new file mode 100644 index 00000000..bb2c1317 --- /dev/null +++ b/vendor/webmozart/assert/.travis.yml @@ -0,0 +1,35 @@ +language: php + +sudo: false + +cache: + directories: + - $HOME/.composer/cache/files + +matrix: + include: + - php: 5.3 + - php: 5.4 + - php: 5.5 + - php: 5.6 + - php: hhvm + - php: nightly + - php: 7.0 + env: COVERAGE=yes + - php: 7.0 + env: COMPOSER_FLAGS='--prefer-lowest --prefer-stable' + allow_failures: + - php: hhvm + - php: nightly + fast_finish: true + +before_install: + - if [[ $TRAVIS_PHP_VERSION != hhvm && $COVERAGE != yes ]]; then phpenv config-rm xdebug.ini; fi; + - if [[ $TRAVIS_REPO_SLUG = webmozart/assert ]]; then cp .composer-auth.json ~/.composer/auth.json; fi; + - composer self-update + +install: composer update $COMPOSER_FLAGS --prefer-dist --no-interaction + +script: if [[ $COVERAGE = yes ]]; then vendor/bin/phpunit --verbose --coverage-clover=coverage.clover; else vendor/bin/phpunit --verbose; fi + +after_script: if [[ $COVERAGE = yes ]]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi diff --git a/vendor/webmozart/assert/CHANGELOG.md b/vendor/webmozart/assert/CHANGELOG.md new file mode 100644 index 00000000..16e01119 --- /dev/null +++ b/vendor/webmozart/assert/CHANGELOG.md @@ -0,0 +1,28 @@ +Changelog +========= + +* 1.1.0 (2016-08-09) + + * added `Assert::object()` + * added `Assert::propertyExists()` + * added `Assert::propertyNotExists()` + * added `Assert::methodExists()` + * added `Assert::methodNotExists()` + * added `Assert::uuid()` + +* 1.0.2 (2015-08-24) + + * integrated Style CI + * add tests for minimum package dependencies on Travis CI + +* 1.0.1 (2015-05-12) + + * added support for PHP 5.3.3 + +* 1.0.0 (2015-05-12) + + * first stable release + +* 1.0.0-beta (2015-03-19) + + * first beta release diff --git a/vendor/webmozart/assert/LICENSE b/vendor/webmozart/assert/LICENSE new file mode 100644 index 00000000..9e2e3075 --- /dev/null +++ b/vendor/webmozart/assert/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2014 Bernhard Schussek + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/webmozart/assert/README.md b/vendor/webmozart/assert/README.md new file mode 100644 index 00000000..f72fdc4c --- /dev/null +++ b/vendor/webmozart/assert/README.md @@ -0,0 +1,235 @@ +Webmozart Assert +================ + +[![Build Status](https://travis-ci.org/webmozart/assert.svg?branch=1.1.0)](https://travis-ci.org/webmozart/assert) +[![Build status](https://ci.appveyor.com/api/projects/status/lyg83bcsisrr94se/branch/master?svg=true)](https://ci.appveyor.com/project/webmozart/assert/branch/master) +[![Latest Stable Version](https://poser.pugx.org/webmozart/assert/v/stable.svg)](https://packagist.org/packages/webmozart/assert) +[![Total Downloads](https://poser.pugx.org/webmozart/assert/downloads.svg)](https://packagist.org/packages/webmozart/assert) +[![Dependency Status](https://www.versioneye.com/php/webmozart:assert/1.1.0/badge.svg)](https://www.versioneye.com/php/webmozart:assert/1.1.0) + +Latest release: [1.1.0](https://packagist.org/packages/webmozart/assert#1.1.0) + +PHP >= 5.3.9 + +This library contains efficient assertions to test the input and output of +your methods. With these assertions, you can greatly reduce the amount of coding +needed to write a safe implementation. + +All assertions in the [`Assert`] class throw an `\InvalidArgumentException` if +they fail. + +FAQ +--- + +**What's the difference to [beberlei/assert]?** + +This library is heavily inspired by Benjamin Eberlei's wonderful [assert package], +but fixes a usability issue with error messages that can't be fixed there without +breaking backwards compatibility. + +This package features usable error messages by default. However, you can also +easily write custom error messages: + +``` +Assert::string($path, 'The path is expected to be a string. Got: %s'); +``` + +In [beberlei/assert], the ordering of the `%s` placeholders is different for +every assertion. This package, on the contrary, provides consistent placeholder +ordering for all assertions: + +* `%s`: The tested value as string, e.g. `"/foo/bar"`. +* `%2$s`, `%3$s`, ...: Additional assertion-specific values, e.g. the + minimum/maximum length, allowed values, etc. + +Check the source code of the assertions to find out details about the additional +available placeholders. + +Installation +------------ + +Use [Composer] to install the package: + +``` +$ composer require webmozart/assert +``` + +Example +------- + +```php +use Webmozart\Assert\Assert; + +class Employee +{ + public function __construct($id) + { + Assert::integer($id, 'The employee ID must be an integer. Got: %s'); + Assert::greaterThan($id, 0, 'The employee ID must be a positive integer. Got: %s'); + } +} +``` + +If you create an employee with an invalid ID, an exception is thrown: + +```php +new Employee('foobar'); +// => InvalidArgumentException: +// The employee ID must be an integer. Got: string + +new Employee(-10); +// => InvalidArgumentException: +// The employee ID must be a positive integer. Got: -10 +``` + +Assertions +---------- + +The [`Assert`] class provides the following assertions: + +### Type Assertions + +Method | Description +----------------------------------------------- | -------------------------------------------------- +`string($value, $message = '')` | Check that a value is a string +`stringNotEmpty($value, $message = '')` | Check that a value is a non-empty string +`integer($value, $message = '')` | Check that a value is an integer +`integerish($value, $message = '')` | Check that a value casts to an integer +`float($value, $message = '')` | Check that a value is a float +`numeric($value, $message = '')` | Check that a value is numeric +`boolean($value, $message = '')` | Check that a value is a boolean +`scalar($value, $message = '')` | Check that a value is a scalar +`object($value, $message = '')` | Check that a value is an object +`resource($value, $type = null, $message = '')` | Check that a value is a resource +`isCallable($value, $message = '')` | Check that a value is a callable +`isArray($value, $message = '')` | Check that a value is an array +`isTraversable($value, $message = '')` | Check that a value is an array or a `\Traversable` +`isInstanceOf($value, $class, $message = '')` | Check that a value is an `instanceof` a class +`notInstanceOf($value, $class, $message = '')` | Check that a value is not an `instanceof` a class + +### Comparison Assertions + +Method | Description +----------------------------------------------- | -------------------------------------------------- +`true($value, $message = '')` | Check that a value is `true` +`false($value, $message = '')` | Check that a value is `false` +`null($value, $message = '')` | Check that a value is `null` +`notNull($value, $message = '')` | Check that a value is not `null` +`isEmpty($value, $message = '')` | Check that a value is `empty()` +`notEmpty($value, $message = '')` | Check that a value is not `empty()` +`eq($value, $value2, $message = '')` | Check that a value equals another (`==`) +`notEq($value, $value2, $message = '')` | Check that a value does not equal another (`!=`) +`same($value, $value2, $message = '')` | Check that a value is identical to another (`===`) +`notSame($value, $value2, $message = '')` | Check that a value is not identical to another (`!==`) +`greaterThan($value, $value2, $message = '')` | Check that a value is greater than another +`greaterThanEq($value, $value2, $message = '')` | Check that a value is greater than or equal to another +`lessThan($value, $value2, $message = '')` | Check that a value is less than another +`lessThanEq($value, $value2, $message = '')` | Check that a value is less than or equal to another +`range($value, $min, $max, $message = '')` | Check that a value is within a range +`oneOf($value, array $values, $message = '')` | Check that a value is one of a list of values + +### String Assertions + +You should check that a value is a string with `Assert::string()` before making +any of the following assertions. + +Method | Description +--------------------------------------------------- | -------------------------------------------------- +`contains($value, $subString, $message = '')` | Check that a string contains a substring +`startsWith($value, $prefix, $message = '')` | Check that a string has a prefix +`startsWithLetter($value, $message = '')` | Check that a string starts with a letter +`endsWith($value, $suffix, $message = '')` | Check that a string has a suffix +`regex($value, $pattern, $message = '')` | Check that a string matches a regular expression +`alpha($value, $message = '')` | Check that a string contains letters only +`digits($value, $message = '')` | Check that a string contains digits only +`alnum($value, $message = '')` | Check that a string contains letters and digits only +`lower($value, $message = '')` | Check that a string contains lowercase characters only +`upper($value, $message = '')` | Check that a string contains uppercase characters only +`length($value, $length, $message = '')` | Check that a string has a certain number of characters +`minLength($value, $min, $message = '')` | Check that a string has at least a certain number of characters +`maxLength($value, $max, $message = '')` | Check that a string has at most a certain number of characters +`lengthBetween($value, $min, $max, $message = '')` | Check that a string has a length in the given range +`uuid($value, $message = '')` | Check that a string is a valid UUID + +### File Assertions + +Method | Description +----------------------------------- | -------------------------------------------------- +`fileExists($value, $message = '')` | Check that a value is an existing path +`file($value, $message = '')` | Check that a value is an existing file +`directory($value, $message = '')` | Check that a value is an existing directory +`readable($value, $message = '')` | Check that a value is a readable path +`writable($value, $message = '')` | Check that a value is a writable path + +### Object Assertions + +Method | Description +----------------------------------------------------- | -------------------------------------------------- +`classExists($value, $message = '')` | Check that a value is an existing class name +`subclassOf($value, $class, $message = '')` | Check that a class is a subclass of another +`implementsInterface($value, $class, $message = '')` | Check that a class implements an interface +`propertyExists($value, $property, $message = '')` | Check that a property exists in a class/object +`propertyNotExists($value, $property, $message = '')` | Check that a property does not exist in a class/object +`methodExists($value, $method, $message = '')` | Check that a method exists in a class/object +`methodNotExists($value, $method, $message = '')` | Check that a method does not exist in a class/object + +### Array Assertions + +Method | Description +------------------------------------------- | -------------------------------------------------- +`keyExists($array, $key, $message = '')` | Check that a key exists in an array +`keyNotExists($array, $key, $message = '')` | Check that a key does not exist in an array + +### Collection Assertions + +All of the above assertions can be prefixed with `all*()` to test the contents +of an array or a `\Traversable`: + +```php +Assert::allIsInstanceOf('Acme\Employee', $employees); +``` + +### Nullable Assertions + +All of the above assertions can be prefixed with `nullOr*()` to run the +assertion only if it the value is not `null`: + +```php +Assert::nullOrString($middleName, 'The middle name must be a string or null. Got: %s'); +``` + +Authors +------- + +* [Bernhard Schussek] a.k.a. [@webmozart] +* [The Community Contributors] + +Contribute +---------- + +Contributions to the package are always welcome! + +* Report any bugs or issues you find on the [issue tracker]. +* You can grab the source code at the package's [Git repository]. + +Support +------- + +If you are having problems, send a mail to bschussek@gmail.com or shout out to +[@webmozart] on Twitter. + +License +------- + +All contents of this package are licensed under the [MIT license]. + +[beberlei/assert]: https://github.com/beberlei/assert +[assert package]: https://github.com/beberlei/assert +[Composer]: https://getcomposer.org +[Bernhard Schussek]: http://webmozarts.com +[The Community Contributors]: https://github.com/webmozart/assert/graphs/contributors +[issue tracker]: https://github.com/webmozart/assert +[Git repository]: https://github.com/webmozart/assert +[@webmozart]: https://twitter.com/webmozart +[MIT license]: LICENSE +[`Assert`]: src/Assert.php diff --git a/vendor/webmozart/assert/appveyor.yml b/vendor/webmozart/assert/appveyor.yml new file mode 100644 index 00000000..72e614de --- /dev/null +++ b/vendor/webmozart/assert/appveyor.yml @@ -0,0 +1,36 @@ +build: false +platform: x86 +clone_folder: c:\projects\webmozart\assert + +cache: + - c:\php -> appveyor.yml + +init: + - SET PATH=c:\php;%PATH% + - SET COMPOSER_NO_INTERACTION=1 + - SET PHP=1 + +install: + - IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php) + - cd c:\php + - IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-7.0.0-nts-Win32-VC14-x86.zip + - IF %PHP%==1 7z x php-7.0.0-nts-Win32-VC14-x86.zip -y >nul + - IF %PHP%==1 del /Q *.zip + - IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat + - IF %PHP%==1 copy /Y php.ini-development php.ini + - IF %PHP%==1 echo max_execution_time=1200 >> php.ini + - IF %PHP%==1 echo date.timezone="UTC" >> php.ini + - IF %PHP%==1 echo extension_dir=ext >> php.ini + - IF %PHP%==1 echo extension=php_curl.dll >> php.ini + - IF %PHP%==1 echo extension=php_openssl.dll >> php.ini + - IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini + - IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini + - appveyor DownloadFile https://getcomposer.org/composer.phar + - cd c:\projects\webmozart\assert + - mkdir %APPDATA%\Composer + - IF %APPVEYOR_REPO_NAME%==webmozart/assert copy /Y .composer-auth.json %APPDATA%\Composer\auth.json + - composer update --prefer-dist --no-progress --ansi + +test_script: + - cd c:\projects\webmozart\assert + - vendor\bin\phpunit.bat --verbose diff --git a/vendor/webmozart/assert/composer.json b/vendor/webmozart/assert/composer.json new file mode 100644 index 00000000..836ac72b --- /dev/null +++ b/vendor/webmozart/assert/composer.json @@ -0,0 +1,34 @@ +{ + "name": "webmozart/assert", + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": ["assert", "check", "validate"], + "license": "MIT", + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "require": { + "php": "^5.3.3|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Webmozart\\Assert\\Tests\\": "tests/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.2-dev" + } + } +} diff --git a/vendor/webmozart/assert/phpunit.xml.dist b/vendor/webmozart/assert/phpunit.xml.dist new file mode 100644 index 00000000..db20e9b4 --- /dev/null +++ b/vendor/webmozart/assert/phpunit.xml.dist @@ -0,0 +1,16 @@ + + + + + + ./tests/ + + + + + + + ./src/ + + + diff --git a/vendor/webmozart/assert/src/Assert.php b/vendor/webmozart/assert/src/Assert.php new file mode 100644 index 00000000..a5f09bba --- /dev/null +++ b/vendor/webmozart/assert/src/Assert.php @@ -0,0 +1,903 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Webmozart\Assert; + +use BadMethodCallException; +use InvalidArgumentException; +use Traversable; + +/** + * Efficient assertions to validate the input/output of your methods. + * + * @method static void nullOrString($value, $message = '') + * @method static void nullOrStringNotEmpty($value, $message = '') + * @method static void nullOrInteger($value, $message = '') + * @method static void nullOrIntegerish($value, $message = '') + * @method static void nullOrFloat($value, $message = '') + * @method static void nullOrNumeric($value, $message = '') + * @method static void nullOrBoolean($value, $message = '') + * @method static void nullOrScalar($value, $message = '') + * @method static void nullOrObject($value, $message = '') + * @method static void nullOrResource($value, $type = null, $message = '') + * @method static void nullOrIsCallable($value, $message = '') + * @method static void nullOrIsArray($value, $message = '') + * @method static void nullOrIsTraversable($value, $message = '') + * @method static void nullOrIsInstanceOf($value, $class, $message = '') + * @method static void nullOrNotInstanceOf($value, $class, $message = '') + * @method static void nullOrIsEmpty($value, $message = '') + * @method static void nullOrNotEmpty($value, $message = '') + * @method static void nullOrTrue($value, $message = '') + * @method static void nullOrFalse($value, $message = '') + * @method static void nullOrEq($value, $value2, $message = '') + * @method static void nullOrNotEq($value,$value2, $message = '') + * @method static void nullOrSame($value, $value2, $message = '') + * @method static void nullOrNotSame($value, $value2, $message = '') + * @method static void nullOrGreaterThan($value, $value2, $message = '') + * @method static void nullOrGreaterThanEq($value, $value2, $message = '') + * @method static void nullOrLessThan($value, $value2, $message = '') + * @method static void nullOrLessThanEq($value, $value2, $message = '') + * @method static void nullOrRange($value, $min, $max, $message = '') + * @method static void nullOrOneOf($value, $values, $message = '') + * @method static void nullOrContains($value, $subString, $message = '') + * @method static void nullOrStartsWith($value, $prefix, $message = '') + * @method static void nullOrStartsWithLetter($value, $message = '') + * @method static void nullOrEndsWith($value, $suffix, $message = '') + * @method static void nullOrRegex($value, $pattern, $message = '') + * @method static void nullOrAlpha($value, $message = '') + * @method static void nullOrDigits($value, $message = '') + * @method static void nullOrAlnum($value, $message = '') + * @method static void nullOrLower($value, $message = '') + * @method static void nullOrUpper($value, $message = '') + * @method static void nullOrLength($value, $length, $message = '') + * @method static void nullOrMinLength($value, $min, $message = '') + * @method static void nullOrMaxLength($value, $max, $message = '') + * @method static void nullOrLengthBetween($value, $min, $max, $message = '') + * @method static void nullOrFileExists($value, $message = '') + * @method static void nullOrFile($value, $message = '') + * @method static void nullOrDirectory($value, $message = '') + * @method static void nullOrReadable($value, $message = '') + * @method static void nullOrWritable($value, $message = '') + * @method static void nullOrClassExists($value, $message = '') + * @method static void nullOrSubclassOf($value, $class, $message = '') + * @method static void nullOrImplementsInterface($value, $interface, $message = '') + * @method static void nullOrPropertyExists($value, $property, $message = '') + * @method static void nullOrPropertyNotExists($value, $property, $message = '') + * @method static void nullOrMethodExists($value, $method, $message = '') + * @method static void nullOrMethodNotExists($value, $method, $message = '') + * @method static void nullOrKeyExists($value, $key, $message = '') + * @method static void nullOrKeyNotExists($value, $key, $message = '') + * @method static void nullOrUuid($values, $message = '') + * @method static void allString($values, $message = '') + * @method static void allStringNotEmpty($values, $message = '') + * @method static void allInteger($values, $message = '') + * @method static void allIntegerish($values, $message = '') + * @method static void allFloat($values, $message = '') + * @method static void allNumeric($values, $message = '') + * @method static void allBoolean($values, $message = '') + * @method static void allScalar($values, $message = '') + * @method static void allObject($values, $message = '') + * @method static void allResource($values, $type = null, $message = '') + * @method static void allIsCallable($values, $message = '') + * @method static void allIsArray($values, $message = '') + * @method static void allIsTraversable($values, $message = '') + * @method static void allIsInstanceOf($values, $class, $message = '') + * @method static void allNotInstanceOf($values, $class, $message = '') + * @method static void allNull($values, $message = '') + * @method static void allNotNull($values, $message = '') + * @method static void allIsEmpty($values, $message = '') + * @method static void allNotEmpty($values, $message = '') + * @method static void allTrue($values, $message = '') + * @method static void allFalse($values, $message = '') + * @method static void allEq($values, $value2, $message = '') + * @method static void allNotEq($values,$value2, $message = '') + * @method static void allSame($values, $value2, $message = '') + * @method static void allNotSame($values, $value2, $message = '') + * @method static void allGreaterThan($values, $value2, $message = '') + * @method static void allGreaterThanEq($values, $value2, $message = '') + * @method static void allLessThan($values, $value2, $message = '') + * @method static void allLessThanEq($values, $value2, $message = '') + * @method static void allRange($values, $min, $max, $message = '') + * @method static void allOneOf($values, $values, $message = '') + * @method static void allContains($values, $subString, $message = '') + * @method static void allStartsWith($values, $prefix, $message = '') + * @method static void allStartsWithLetter($values, $message = '') + * @method static void allEndsWith($values, $suffix, $message = '') + * @method static void allRegex($values, $pattern, $message = '') + * @method static void allAlpha($values, $message = '') + * @method static void allDigits($values, $message = '') + * @method static void allAlnum($values, $message = '') + * @method static void allLower($values, $message = '') + * @method static void allUpper($values, $message = '') + * @method static void allLength($values, $length, $message = '') + * @method static void allMinLength($values, $min, $message = '') + * @method static void allMaxLength($values, $max, $message = '') + * @method static void allLengthBetween($values, $min, $max, $message = '') + * @method static void allFileExists($values, $message = '') + * @method static void allFile($values, $message = '') + * @method static void allDirectory($values, $message = '') + * @method static void allReadable($values, $message = '') + * @method static void allWritable($values, $message = '') + * @method static void allClassExists($values, $message = '') + * @method static void allSubclassOf($values, $class, $message = '') + * @method static void allImplementsInterface($values, $interface, $message = '') + * @method static void allPropertyExists($values, $property, $message = '') + * @method static void allPropertyNotExists($values, $property, $message = '') + * @method static void allMethodExists($values, $method, $message = '') + * @method static void allMethodNotExists($values, $method, $message = '') + * @method static void allKeyExists($values, $key, $message = '') + * @method static void allKeyNotExists($values, $key, $message = '') + * @method static void allUuid($values, $message = '') + * + * @since 1.0 + * + * @author Bernhard Schussek + */ +class Assert +{ + public static function string($value, $message = '') + { + if (!is_string($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a string. Got: %s', + self::typeToString($value) + )); + } + } + + public static function stringNotEmpty($value, $message = '') + { + self::string($value, $message); + self::notEmpty($value, $message); + } + + public static function integer($value, $message = '') + { + if (!is_int($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an integer. Got: %s', + self::typeToString($value) + )); + } + } + + public static function integerish($value, $message = '') + { + if (!is_numeric($value) || $value != (int) $value) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an integerish value. Got: %s', + self::typeToString($value) + )); + } + } + + public static function float($value, $message = '') + { + if (!is_float($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a float. Got: %s', + self::typeToString($value) + )); + } + } + + public static function numeric($value, $message = '') + { + if (!is_numeric($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a numeric. Got: %s', + self::typeToString($value) + )); + } + } + + public static function boolean($value, $message = '') + { + if (!is_bool($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a boolean. Got: %s', + self::typeToString($value) + )); + } + } + + public static function scalar($value, $message = '') + { + if (!is_scalar($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a scalar. Got: %s', + self::typeToString($value) + )); + } + } + + public static function object($value, $message = '') + { + if (!is_object($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an object. Got: %s', + self::typeToString($value) + )); + } + } + + public static function resource($value, $type = null, $message = '') + { + if (!is_resource($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a resource. Got: %s', + self::typeToString($value) + )); + } + + if ($type && $type !== get_resource_type($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a resource of type %2$s. Got: %s', + self::typeToString($value), + $type + )); + } + } + + public static function isCallable($value, $message = '') + { + if (!is_callable($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a callable. Got: %s', + self::typeToString($value) + )); + } + } + + public static function isArray($value, $message = '') + { + if (!is_array($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an array. Got: %s', + self::typeToString($value) + )); + } + } + + public static function isTraversable($value, $message = '') + { + if (!is_array($value) && !($value instanceof Traversable)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a traversable. Got: %s', + self::typeToString($value) + )); + } + } + + public static function isInstanceOf($value, $class, $message = '') + { + if (!($value instanceof $class)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an instance of %2$s. Got: %s', + self::typeToString($value), + $class + )); + } + } + + public static function notInstanceOf($value, $class, $message = '') + { + if ($value instanceof $class) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an instance other than %2$s. Got: %s', + self::typeToString($value), + $class + )); + } + } + + public static function isEmpty($value, $message = '') + { + if (!empty($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an empty value. Got: %s', + self::valueToString($value) + )); + } + } + + public static function notEmpty($value, $message = '') + { + if (empty($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a non-empty value. Got: %s', + self::valueToString($value) + )); + } + } + + public static function null($value, $message = '') + { + if (null !== $value) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected null. Got: %s', + self::valueToString($value) + )); + } + } + + public static function notNull($value, $message = '') + { + if (null === $value) { + throw new InvalidArgumentException( + $message ?: 'Expected a value other than null.' + ); + } + } + + public static function true($value, $message = '') + { + if (true !== $value) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to be true. Got: %s', + self::valueToString($value) + )); + } + } + + public static function false($value, $message = '') + { + if (false !== $value) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to be false. Got: %s', + self::valueToString($value) + )); + } + } + + public static function eq($value, $value2, $message = '') + { + if ($value2 != $value) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value equal to %2$s. Got: %s', + self::valueToString($value), + self::valueToString($value2) + )); + } + } + + public static function notEq($value, $value2, $message = '') + { + if ($value2 == $value) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a different value than %s.', + self::valueToString($value2) + )); + } + } + + public static function same($value, $value2, $message = '') + { + if ($value2 !== $value) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value identical to %2$s. Got: %s', + self::valueToString($value), + self::valueToString($value2) + )); + } + } + + public static function notSame($value, $value2, $message = '') + { + if ($value2 === $value) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value not identical to %s.', + self::valueToString($value2) + )); + } + } + + public static function greaterThan($value, $limit, $message = '') + { + if ($value <= $limit) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value greater than %2$s. Got: %s', + self::valueToString($value), + self::valueToString($limit) + )); + } + } + + public static function greaterThanEq($value, $limit, $message = '') + { + if ($value < $limit) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value greater than or equal to %2$s. Got: %s', + self::valueToString($value), + self::valueToString($limit) + )); + } + } + + public static function lessThan($value, $limit, $message = '') + { + if ($value >= $limit) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value less than %2$s. Got: %s', + self::valueToString($value), + self::valueToString($limit) + )); + } + } + + public static function lessThanEq($value, $limit, $message = '') + { + if ($value > $limit) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value less than or equal to %2$s. Got: %s', + self::valueToString($value), + self::valueToString($limit) + )); + } + } + + public static function range($value, $min, $max, $message = '') + { + if ($value < $min || $value > $max) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value between %2$s and %3$s. Got: %s', + self::valueToString($value), + self::valueToString($min), + self::valueToString($max) + )); + } + } + + public static function oneOf($value, array $values, $message = '') + { + if (!in_array($value, $values, true)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected one of: %2$s. Got: %s', + self::valueToString($value), + implode(', ', array_map(array(__CLASS__, 'valueToString'), $values)) + )); + } + } + + public static function contains($value, $subString, $message = '') + { + if (false === strpos($value, $subString)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain %2$s. Got: %s', + self::valueToString($value), + self::valueToString($subString) + )); + } + } + + public static function startsWith($value, $prefix, $message = '') + { + if (0 !== strpos($value, $prefix)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to start with %2$s. Got: %s', + self::valueToString($value), + self::valueToString($prefix) + )); + } + } + + public static function startsWithLetter($value, $message = '') + { + $valid = isset($value[0]); + + if ($valid) { + $locale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, 'C'); + $valid = ctype_alpha($value[0]); + setlocale(LC_CTYPE, $locale); + } + + if (!$valid) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to start with a letter. Got: %s', + self::valueToString($value) + )); + } + } + + public static function endsWith($value, $suffix, $message = '') + { + if ($suffix !== substr($value, -self::strlen($suffix))) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to end with %2$s. Got: %s', + self::valueToString($value), + self::valueToString($suffix) + )); + } + } + + public static function regex($value, $pattern, $message = '') + { + if (!preg_match($pattern, $value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'The value %s does not match the expected pattern.', + self::valueToString($value) + )); + } + } + + public static function alpha($value, $message = '') + { + $locale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, 'C'); + $valid = !ctype_alpha($value); + setlocale(LC_CTYPE, $locale); + + if ($valid) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain only letters. Got: %s', + self::valueToString($value) + )); + } + } + + public static function digits($value, $message = '') + { + $locale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, 'C'); + $valid = !ctype_digit($value); + setlocale(LC_CTYPE, $locale); + + if ($valid) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain digits only. Got: %s', + self::valueToString($value) + )); + } + } + + public static function alnum($value, $message = '') + { + $locale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, 'C'); + $valid = !ctype_alnum($value); + setlocale(LC_CTYPE, $locale); + + if ($valid) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain letters and digits only. Got: %s', + self::valueToString($value) + )); + } + } + + public static function lower($value, $message = '') + { + $locale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, 'C'); + $valid = !ctype_lower($value); + setlocale(LC_CTYPE, $locale); + + if ($valid) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain lowercase characters only. Got: %s', + self::valueToString($value) + )); + } + } + + public static function upper($value, $message = '') + { + $locale = setlocale(LC_CTYPE, 0); + setlocale(LC_CTYPE, 'C'); + $valid = !ctype_upper($value); + setlocale(LC_CTYPE, $locale); + + if ($valid) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain uppercase characters only. Got: %s', + self::valueToString($value) + )); + } + } + + public static function length($value, $length, $message = '') + { + if ($length !== self::strlen($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain %2$s characters. Got: %s', + self::valueToString($value), + $length + )); + } + } + + public static function minLength($value, $min, $message = '') + { + if (self::strlen($value) < $min) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain at least %2$s characters. Got: %s', + self::valueToString($value), + $min + )); + } + } + + public static function maxLength($value, $max, $message = '') + { + if (self::strlen($value) > $max) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain at most %2$s characters. Got: %s', + self::valueToString($value), + $max + )); + } + } + + public static function lengthBetween($value, $min, $max, $message = '') + { + $length = self::strlen($value); + + if ($length < $min || $length > $max) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a value to contain between %2$s and %3$s characters. Got: %s', + self::valueToString($value), + $min, + $max + )); + } + } + + public static function fileExists($value, $message = '') + { + self::string($value); + + if (!file_exists($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'The file %s does not exist.', + self::valueToString($value) + )); + } + } + + public static function file($value, $message = '') + { + self::fileExists($value, $message); + + if (!is_file($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'The path %s is not a file.', + self::valueToString($value) + )); + } + } + + public static function directory($value, $message = '') + { + self::fileExists($value, $message); + + if (!is_dir($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'The path %s is no directory.', + self::valueToString($value) + )); + } + } + + public static function readable($value, $message = '') + { + if (!is_readable($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'The path %s is not readable.', + self::valueToString($value) + )); + } + } + + public static function writable($value, $message = '') + { + if (!is_writable($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'The path %s is not writable.', + self::valueToString($value) + )); + } + } + + public static function classExists($value, $message = '') + { + if (!class_exists($value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an existing class name. Got: %s', + self::valueToString($value) + )); + } + } + + public static function subclassOf($value, $class, $message = '') + { + if (!is_subclass_of($value, $class)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected a sub-class of %2$s. Got: %s', + self::valueToString($value), + self::valueToString($class) + )); + } + } + + public static function implementsInterface($value, $interface, $message = '') + { + if (!in_array($interface, class_implements($value))) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected an implementation of %2$s. Got: %s', + self::valueToString($value), + self::valueToString($interface) + )); + } + } + + public static function propertyExists($classOrObject, $property, $message = '') + { + if (!property_exists($classOrObject, $property)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected the property %s to exist.', + self::valueToString($property) + )); + } + } + + public static function propertyNotExists($classOrObject, $property, $message = '') + { + if (property_exists($classOrObject, $property)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected the property %s to not exist.', + self::valueToString($property) + )); + } + } + + public static function methodExists($classOrObject, $method, $message = '') + { + if (!method_exists($classOrObject, $method)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected the method %s to exist.', + self::valueToString($method) + )); + } + } + + public static function methodNotExists($classOrObject, $method, $message = '') + { + if (method_exists($classOrObject, $method)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected the method %s to not exist.', + self::valueToString($method) + )); + } + } + + public static function keyExists($array, $key, $message = '') + { + if (!array_key_exists($key, $array)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected the key %s to exist.', + self::valueToString($key) + )); + } + } + + public static function keyNotExists($array, $key, $message = '') + { + if (array_key_exists($key, $array)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Expected the key %s to not exist.', + self::valueToString($key) + )); + } + } + + public static function uuid($value, $message = '') + { + $value = str_replace(array('urn:', 'uuid:', '{', '}'), '', $value); + + // The nil UUID is special form of UUID that is specified to have all + // 128 bits set to zero. + if ('00000000-0000-0000-0000-000000000000' === $value) { + return; + } + + if (!preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) { + throw new InvalidArgumentException(sprintf( + $message ?: 'Value "%s" is not a valid UUID.', + self::valueToString($value) + )); + } + } + + public static function __callStatic($name, $arguments) + { + if ('nullOr' === substr($name, 0, 6)) { + if (null !== $arguments[0]) { + $method = lcfirst(substr($name, 6)); + call_user_func_array(array('static', $method), $arguments); + } + + return; + } + + if ('all' === substr($name, 0, 3)) { + self::isTraversable($arguments[0]); + + $method = lcfirst(substr($name, 3)); + $args = $arguments; + + foreach ($arguments[0] as $entry) { + $args[0] = $entry; + + call_user_func_array(array('static', $method), $args); + } + + return; + } + + throw new BadMethodCallException('No such method: '.$name); + } + + protected static function valueToString($value) + { + if (null === $value) { + return 'null'; + } + + if (true === $value) { + return 'true'; + } + + if (false === $value) { + return 'false'; + } + + if (is_array($value)) { + return 'array'; + } + + if (is_object($value)) { + return get_class($value); + } + + if (is_resource($value)) { + return 'resource'; + } + + if (is_string($value)) { + return '"'.$value.'"'; + } + + return (string) $value; + } + + protected static function typeToString($value) + { + return is_object($value) ? get_class($value) : gettype($value); + } + + protected static function strlen($value) + { + if (!function_exists('mb_detect_encoding')) { + return strlen($value); + } + + if (false === $encoding = mb_detect_encoding($value)) { + return strlen($value); + } + + return mb_strwidth($value, $encoding); + } + + private function __construct() + { + } +} diff --git a/vendor/webmozart/assert/tests/AssertTest.php b/vendor/webmozart/assert/tests/AssertTest.php new file mode 100644 index 00000000..2a26497e --- /dev/null +++ b/vendor/webmozart/assert/tests/AssertTest.php @@ -0,0 +1,422 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Webmozart\Assert\Tests; + +use ArrayIterator; +use Exception; +use PHPUnit_Framework_TestCase; +use RuntimeException; +use stdClass; +use Webmozart\Assert\Assert; + +/** + * @since 1.0 + * + * @author Bernhard Schussek + */ +class AssertTest extends PHPUnit_Framework_TestCase +{ + private static $resource; + + public static function getResource() + { + if (!static::$resource) { + static::$resource = fopen(__FILE__, 'r'); + } + + return static::$resource; + } + + public static function tearDownAfterClass() + { + @fclose(self::$resource); + } + + public function getTests() + { + $resource = self::getResource(); + + return array( + array('string', array('value'), true), + array('string', array(''), true), + array('string', array(1234), false), + array('stringNotEmpty', array('value'), true), + array('stringNotEmpty', array(''), false), + array('stringNotEmpty', array(1234), false), + array('integer', array(123), true), + array('integer', array('123'), false), + array('integer', array(1.0), false), + array('integer', array(1.23), false), + array('integerish', array(1.0), true), + array('integerish', array(1.23), false), + array('integerish', array(123), true), + array('integerish', array('123'), true), + array('float', array(1.0), true), + array('float', array(1.23), true), + array('float', array(123), false), + array('float', array('123'), false), + array('numeric', array(1.0), true), + array('numeric', array(1.23), true), + array('numeric', array(123), true), + array('numeric', array('123'), true), + array('numeric', array('foo'), false), + array('boolean', array(true), true), + array('boolean', array(false), true), + array('boolean', array(1), false), + array('boolean', array('1'), false), + array('scalar', array('1'), true), + array('scalar', array(123), true), + array('scalar', array(true), true), + array('scalar', array(null), false), + array('scalar', array(array()), false), + array('scalar', array(new stdClass()), false), + array('object', array(new stdClass()), true), + array('object', array(new RuntimeException()), true), + array('object', array(null), false), + array('object', array(true), false), + array('object', array(1), false), + array('object', array(array()), false), + array('resource', array($resource), true), + array('resource', array($resource, 'stream'), true), + array('resource', array($resource, 'other'), false), + array('resource', array(1), false), + array('isCallable', array('strlen'), true), + array('isCallable', array(array($this, 'getTests')), true), + array('isCallable', array(function () {}), true), + array('isCallable', array(1234), false), + array('isCallable', array('foobar'), false), + array('isArray', array(array()), true), + array('isArray', array(array(1, 2, 3)), true), + array('isArray', array(new ArrayIterator(array())), false), + array('isArray', array(123), false), + array('isArray', array(new stdClass()), false), + array('isTraversable', array(array()), true), + array('isTraversable', array(array(1, 2, 3)), true), + array('isTraversable', array(new ArrayIterator(array())), true), + array('isTraversable', array(123), false), + array('isTraversable', array(new stdClass()), false), + array('isInstanceOf', array(new stdClass(), 'stdClass'), true), + array('isInstanceOf', array(new Exception(), 'stdClass'), false), + array('isInstanceOf', array(123, 'stdClass'), false), + array('isInstanceOf', array(array(), 'stdClass'), false), + array('notInstanceOf', array(new stdClass(), 'stdClass'), false), + array('notInstanceOf', array(new Exception(), 'stdClass'), true), + array('notInstanceOf', array(123, 'stdClass'), true), + array('notInstanceOf', array(array(), 'stdClass'), true), + array('true', array(true), true), + array('true', array(false), false), + array('true', array(1), false), + array('true', array(null), false), + array('false', array(false), true), + array('false', array(true), false), + array('false', array(1), false), + array('false', array(0), false), + array('false', array(null), false), + array('null', array(null), true), + array('null', array(false), false), + array('null', array(0), false), + array('notNull', array(false), true), + array('notNull', array(0), true), + array('notNull', array(null), false), + array('isEmpty', array(null), true), + array('isEmpty', array(false), true), + array('isEmpty', array(0), true), + array('isEmpty', array(''), true), + array('isEmpty', array(1), false), + array('isEmpty', array('a'), false), + array('notEmpty', array(1), true), + array('notEmpty', array('a'), true), + array('notEmpty', array(null), false), + array('notEmpty', array(false), false), + array('notEmpty', array(0), false), + array('notEmpty', array(''), false), + array('eq', array(1, 1), true), + array('eq', array(1, '1'), true), + array('eq', array(1, true), true), + array('eq', array(1, 0), false), + array('notEq', array(1, 0), true), + array('notEq', array(1, 1), false), + array('notEq', array(1, '1'), false), + array('notEq', array(1, true), false), + array('same', array(1, 1), true), + array('same', array(1, '1'), false), + array('same', array(1, true), false), + array('same', array(1, 0), false), + array('notSame', array(1, 0), true), + array('notSame', array(1, 1), false), + array('notSame', array(1, '1'), true), + array('notSame', array(1, true), true), + array('greaterThan', array(1, 0), true), + array('greaterThan', array(0, 0), false), + array('greaterThanEq', array(2, 1), true), + array('greaterThanEq', array(1, 1), true), + array('greaterThanEq', array(0, 1), false), + array('lessThan', array(0, 1), true), + array('lessThan', array(1, 1), false), + array('lessThanEq', array(0, 1), true), + array('lessThanEq', array(1, 1), true), + array('lessThanEq', array(2, 1), false), + array('range', array(1, 1, 2), true), + array('range', array(2, 1, 2), true), + array('range', array(0, 1, 2), false), + array('range', array(3, 1, 2), false), + array('oneOf', array(1, array(1, 2, 3)), true), + array('oneOf', array(1, array('1', '2', '3')), false), + array('contains', array('abcd', 'ab'), true), + array('contains', array('abcd', 'bc'), true), + array('contains', array('abcd', 'cd'), true), + array('contains', array('abcd', 'de'), false), + array('contains', array('', 'de'), false), + array('startsWith', array('abcd', 'ab'), true), + array('startsWith', array('abcd', 'bc'), false), + array('startsWith', array('', 'bc'), false), + array('startsWithLetter', array('abcd'), true), + array('startsWithLetter', array('1abcd'), false), + array('startsWithLetter', array(''), false), + array('endsWith', array('abcd', 'cd'), true), + array('endsWith', array('abcd', 'bc'), false), + array('endsWith', array('', 'bc'), false), + array('regex', array('abcd', '~^ab~'), true), + array('regex', array('abcd', '~^bc~'), false), + array('regex', array('', '~^bc~'), false), + array('alpha', array('abcd'), true), + array('alpha', array('ab1cd'), false), + array('alpha', array(''), false), + array('digits', array('1234'), true), + array('digits', array('12a34'), false), + array('digits', array(''), false), + array('alnum', array('ab12'), true), + array('alnum', array('ab12$'), false), + array('alnum', array(''), false), + array('lower', array('abcd'), true), + array('lower', array('abCd'), false), + array('lower', array('ab_d'), false), + array('lower', array(''), false), + array('upper', array('ABCD'), true), + array('upper', array('ABcD'), false), + array('upper', array('AB_D'), false), + array('upper', array(''), false), + array('length', array('abcd', 4), true), + array('length', array('abc', 4), false), + array('length', array('abcde', 4), false), + array('length', array('äbcd', 4), true, true), + array('length', array('äbc', 4), false, true), + array('length', array('äbcde', 4), false, true), + array('minLength', array('abcd', 4), true), + array('minLength', array('abcde', 4), true), + array('minLength', array('abc', 4), false), + array('minLength', array('äbcd', 4), true, true), + array('minLength', array('äbcde', 4), true, true), + array('minLength', array('äbc', 4), false, true), + array('maxLength', array('abcd', 4), true), + array('maxLength', array('abc', 4), true), + array('maxLength', array('abcde', 4), false), + array('maxLength', array('äbcd', 4), true, true), + array('maxLength', array('äbc', 4), true, true), + array('maxLength', array('äbcde', 4), false, true), + array('lengthBetween', array('abcd', 3, 5), true), + array('lengthBetween', array('abc', 3, 5), true), + array('lengthBetween', array('abcde', 3, 5), true), + array('lengthBetween', array('ab', 3, 5), false), + array('lengthBetween', array('abcdef', 3, 5), false), + array('lengthBetween', array('äbcd', 3, 5), true, true), + array('lengthBetween', array('äbc', 3, 5), true, true), + array('lengthBetween', array('äbcde', 3, 5), true, true), + array('lengthBetween', array('äb', 3, 5), false, true), + array('lengthBetween', array('äbcdef', 3, 5), false, true), + array('fileExists', array(__FILE__), true), + array('fileExists', array(__DIR__), true), + array('fileExists', array(__DIR__.'/foobar'), false), + array('file', array(__FILE__), true), + array('file', array(__DIR__), false), + array('file', array(__DIR__.'/foobar'), false), + array('directory', array(__DIR__), true), + array('directory', array(__FILE__), false), + array('directory', array(__DIR__.'/foobar'), false), + // no tests for readable()/writable() for now + array('classExists', array(__CLASS__), true), + array('classExists', array(__NAMESPACE__.'\Foobar'), false), + array('subclassOf', array(__CLASS__, 'PHPUnit_Framework_TestCase'), true), + array('subclassOf', array(__CLASS__, 'stdClass'), false), + array('implementsInterface', array('ArrayIterator', 'Traversable'), true), + array('implementsInterface', array(__CLASS__, 'Traversable'), false), + array('propertyExists', array((object) array('property' => 0), 'property'), true), + array('propertyExists', array((object) array('property' => null), 'property'), true), + array('propertyExists', array((object) array('property' => null), 'foo'), false), + array('propertyNotExists', array((object) array('property' => 0), 'property'), false), + array('propertyNotExists', array((object) array('property' => null), 'property'), false), + array('propertyNotExists', array((object) array('property' => null), 'foo'), true), + array('methodExists', array('RuntimeException', 'getMessage'), true), + array('methodExists', array(new RuntimeException(), 'getMessage'), true), + array('methodExists', array('stdClass', 'getMessage'), false), + array('methodExists', array(new stdClass(), 'getMessage'), false), + array('methodExists', array(null, 'getMessage'), false), + array('methodExists', array(true, 'getMessage'), false), + array('methodExists', array(1, 'getMessage'), false), + array('methodNotExists', array('RuntimeException', 'getMessage'), false), + array('methodNotExists', array(new RuntimeException(), 'getMessage'), false), + array('methodNotExists', array('stdClass', 'getMessage'), true), + array('methodNotExists', array(new stdClass(), 'getMessage'), true), + array('methodNotExists', array(null, 'getMessage'), true), + array('methodNotExists', array(true, 'getMessage'), true), + array('methodNotExists', array(1, 'getMessage'), true), + array('keyExists', array(array('key' => 0), 'key'), true), + array('keyExists', array(array('key' => null), 'key'), true), + array('keyExists', array(array('key' => null), 'foo'), false), + array('keyNotExists', array(array('key' => 0), 'key'), false), + array('keyNotExists', array(array('key' => null), 'key'), false), + array('keyNotExists', array(array('key' => null), 'foo'), true), + array('uuid', array('00000000-0000-0000-0000-000000000000'), true), + array('uuid', array('ff6f8cb0-c57d-21e1-9b21-0800200c9a66'), true), + array('uuid', array('ff6f8cb0-c57d-11e1-9b21-0800200c9a66'), true), + array('uuid', array('ff6f8cb0-c57d-31e1-9b21-0800200c9a66'), true), + array('uuid', array('ff6f8cb0-c57d-41e1-9b21-0800200c9a66'), true), + array('uuid', array('ff6f8cb0-c57d-51e1-9b21-0800200c9a66'), true), + array('uuid', array('FF6F8CB0-C57D-11E1-9B21-0800200C9A66'), true), + array('uuid', array('zf6f8cb0-c57d-11e1-9b21-0800200c9a66'), false), + array('uuid', array('af6f8cb0c57d11e19b210800200c9a66'), false), + array('uuid', array('ff6f8cb0-c57da-51e1-9b21-0800200c9a66'), false), + array('uuid', array('af6f8cb-c57d-11e1-9b21-0800200c9a66'), false), + array('uuid', array('3f6f8cb0-c57d-11e1-9b21-0800200c9a6'), false), + + ); + } + + public function getMethods() + { + $methods = array(); + + foreach ($this->getTests() as $params) { + $methods[$params[0]] = array($params[0]); + } + + return array_values($methods); + } + + /** + * @dataProvider getTests + */ + public function testAssert($method, $args, $success, $multibyte = false) + { + if ($multibyte && !function_exists('mb_strlen')) { + $this->markTestSkipped('The fucntion mb_strlen() is not available'); + + return; + } + + if (!$success) { + $this->setExpectedException('\InvalidArgumentException'); + } + + call_user_func_array(array('Webmozart\Assert\Assert', $method), $args); + } + + /** + * @dataProvider getTests + */ + public function testNullOr($method, $args, $success, $multibyte = false) + { + if ($multibyte && !function_exists('mb_strlen')) { + $this->markTestSkipped('The fucntion mb_strlen() is not available'); + + return; + } + + if (!$success && null !== reset($args)) { + $this->setExpectedException('\InvalidArgumentException'); + } + + call_user_func_array(array('Webmozart\Assert\Assert', 'nullOr'.ucfirst($method)), $args); + } + + /** + * @dataProvider getMethods + */ + public function testNullOrAcceptsNull($method) + { + call_user_func(array('Webmozart\Assert\Assert', 'nullOr'.ucfirst($method)), null); + } + + /** + * @dataProvider getTests + */ + public function testAllArray($method, $args, $success, $multibyte = false) + { + if ($multibyte && !function_exists('mb_strlen')) { + $this->markTestSkipped('The fucntion mb_strlen() is not available'); + + return; + } + + if (!$success) { + $this->setExpectedException('\InvalidArgumentException'); + } + + $arg = array_shift($args); + array_unshift($args, array($arg)); + + call_user_func_array(array('Webmozart\Assert\Assert', 'all'.ucfirst($method)), $args); + } + + /** + * @dataProvider getTests + */ + public function testAllTraversable($method, $args, $success, $multibyte = false) + { + if ($multibyte && !function_exists('mb_strlen')) { + $this->markTestSkipped('The fucntion mb_strlen() is not available'); + + return; + } + + if (!$success) { + $this->setExpectedException('\InvalidArgumentException'); + } + + $arg = array_shift($args); + array_unshift($args, new ArrayIterator(array($arg))); + + call_user_func_array(array('Webmozart\Assert\Assert', 'all'.ucfirst($method)), $args); + } + + public function getStringConversions() + { + return array( + array('integer', array('foobar'), 'Expected an integer. Got: string'), + array('string', array(1), 'Expected a string. Got: integer'), + array('string', array(true), 'Expected a string. Got: boolean'), + array('string', array(null), 'Expected a string. Got: NULL'), + array('string', array(array()), 'Expected a string. Got: array'), + array('string', array(new stdClass()), 'Expected a string. Got: stdClass'), + array('string', array(self::getResource()), 'Expected a string. Got: resource'), + + array('eq', array('1', '2'), 'Expected a value equal to "2". Got: "1"'), + array('eq', array(1, 2), 'Expected a value equal to 2. Got: 1'), + array('eq', array(true, false), 'Expected a value equal to false. Got: true'), + array('eq', array(true, null), 'Expected a value equal to null. Got: true'), + array('eq', array(null, true), 'Expected a value equal to true. Got: null'), + array('eq', array(array(1), array(2)), 'Expected a value equal to array. Got: array'), + array('eq', array(new ArrayIterator(array()), new stdClass()), 'Expected a value equal to stdClass. Got: ArrayIterator'), + array('eq', array(1, self::getResource()), 'Expected a value equal to resource. Got: 1'), + ); + } + + /** + * @dataProvider getStringConversions + */ + public function testConvertValuesToStrings($method, $args, $exceptionMessage) + { + $this->setExpectedException('\InvalidArgumentException', $exceptionMessage); + + call_user_func_array(array('Webmozart\Assert\Assert', $method), $args); + } +}