<?php

namespace SwaggerGen\Swagger\Type;

/**
 * Basic file type definition.
 *
 * @package    SwaggerGen
 * @author     Martijn van der Lee <martijn@vanderlee.com>
 * @copyright  2014-2015 Martijn van der Lee
 * @license    https://opensource.org/licenses/MIT MIT
 */
class FileType extends AbstractType
{

	protected function parseDefinition($definition)
	{
		$type = strtolower($definition);

		$parent = $this->getParent();
		if (!($parent instanceof \SwaggerGen\Swagger\Parameter) || !$parent->isForm()) {
			throw new \SwaggerGen\Exception("File type only allowed on form parameter: '{$definition}'");
		}

		$consumes = $this->getParentClass('\SwaggerGen\Swagger\Operation')->getConsumes();
		if (empty($consumes)) {
			$consumes = $this->getRoot()->getConsumes();
		}

		if ($consumes !== array('multipart/form-data') && $consumes !== array('application/x-www-form-urlencoded')) {
			throw new \SwaggerGen\Exception("File type without valid consume: '{$definition}'");
		}
	}

	public function toArray()
	{
		return self::array_filter_null([
					'type' => 'file',
		]);
	}

	public function __toString()
	{
		return __CLASS__;
	}

}

<?php

namespace SwaggerGen\Swagger\Type;

/**
 * Basic file type definition.
 *
 * @package    SwaggerGen
 * @author     Martijn van der Lee <martijn@vanderlee.com>
 * @copyright  2014-2015 Martijn van der Lee
 * @license    https://opensource.org/licenses/MIT MIT
 */
class FileType extends AbstractType
{

	protected function parseDefinition($definition)
	{
		$type = strtolower($definition);

		$parent = $this->getParent();
		if (!($parent instanceof \SwaggerGen\Swagger\Parameter) || !$parent->isForm()) {
			throw new \SwaggerGen\Exception("File type '{$definition}' only allowed on form parameter");
		}

		$consumes = $this->getParentClass('\SwaggerGen\Swagger\Operation')->getConsumes();
		if (empty($consumes)) {
			$consumes = $this->getRoot()->getConsumes();
		}

		$valid_consumes = ((int) in_array('multipart/form-data', $consumes)) + ((int) in_array('application/x-www-form-urlencoded', $consumes));
		if (empty($consumes) || $valid_consumes !== count($consumes)) {
			throw new \SwaggerGen\Exception("File type '{$definition}' without valid consume");
		}
	}

	public function toArray()
	{
		return self::array_filter_null([
					'type' => 'file',
		]);
	}

	public function __toString()
	{
		return __CLASS__;
	}

}

Fix up consume either/both check
Fix up consume either/both check