Set the project.

@param Project|string $project The project or project slug.

@return \CyberSpectrum\Transifex\TranslationResource
186273
public function setProject($project)
    {
        if ($project instanceof Project) {
            $this->project = $project->getSlug();

            return $this;
        }

        $this->project = (string) $project;

        return $this;
    }
1082329
public function get($project, $network, $optParams = array()) {
      $params = array('project' => $project, 'network' => $network);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Google_Network($data);
      } else {
        return $data;
      }
    }
345670
public function set( $method )
	{
		$method		= strtoupper( $method );
		if( !in_array( $method, self::$methods ) )
			throw new BadMethodCallException( 'HTTP method "%s" is not supported' );
		$this->method	= $method;
		return $this;
	}
804178
public function setupProject()
    {
        $this->taskWriteToFile(ProjectX::projectRoot() . '/.gitignore')
            ->text($this->loadTemplateContents('.gitignore.txt'))
            ->place('PROJECT_ROOT', $this->getInstallRoot(true))
            ->run();

        return $this;
    }
1133067
private function setProject(InputInterface $input, OutputInterface $output)
    {
        $this->project = $input->getOption('projectname');
        if (!$this->project) {
            $this->project = $this->getTransifexConfigValue('/project');

            if (!$this->project) {
                throw new \RuntimeException('Error: unable to determine transifex project name.');
            }

            $this->writelnVerbose($output, sprintf('<info>automatically using project: %s</info>', $this->project));
        }

        $this->checkValidSlug($this->project);
    }
166545
public function setTranslation($translation) {
		if(!$this->setModified('translation', $translation)->isModified()) {
			return $this;
		}
		$this->translation = $translation;
		return $this;
	}
238873
public function update(string $project, array $params = [])
    {
        $path = $this->buildProjectsPath($project);

        return $this->put($path, $params);
    }
1064246
public function updateProject(Project $project)
    {
        $request = $this->client->createRequest('PUT', sprintf('/api/projects/%s', $project->getUuid()), null, array('insight_project' => $project->toArray()));

        return $this->serializer->deserialize(
            (string) $this->send($request)->getBody(),
            'SensioLabs\Insight\Sdk\Model\Project',
            'xml'
        );
    }
563061
public function setProjects($projects)
    {
        $this->_projects = [];
        $token           = ' ,;';
        $project         = strtok($projects, $token);

        while ($project !== false) {
            $this->_projects[] = $project;
            $project           = strtok($token);
        }

    }
784459
public function scan($project)
    {
        //@TODO: allow scan of individual files
        // First check if target is a directory
        if (!is_dir($project)) {
            $this->getConsole()->writeLine($project . ' is not a directory!');
            return $this;
        }

        $iteratorIterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($project));

        //@TODO: make ignored paths a param
        // Exclude the paths containing vendor and non-php files
        $regexIterator = new \RegexIterator($iteratorIterator, '/^(?!.*vendor.*).*\.php$/i', \RecursiveRegexIterator::GET_MATCH);

        foreach ($regexIterator as $fileMatches) {
            foreach ($fileMatches as $fileMatch) {

                $fileContent = file_get_contents($fileMatch);

                preg_match_all('/Zend\\\\[a-zA-Z0-9]*/', (string) $fileContent, $matches, PREG_PATTERN_ORDER);

                foreach ($matches as $submatches) {
                    foreach ($submatches as $match) {
                        $zendComponent = strtolower(str_replace('\\', '-', $match));
                        $componentParts = explode('-', $zendComponent);

                        if ($componentParts[0] !== '' && $componentParts[1] !== '') {
                            $this->components[$zendComponent] = true;
                        }
                    }
                }
            }
        }

        ksort($this->components);

        return $this;
    }
16249
public function get($project, $zone, $optParams = array()) {
      $params = array('project' => $project, 'zone' => $zone);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Zone($data);
      } else {
        return $data;
      }
    }
150391
public function setTranslatableLang($lang)
    {
        if (is_string($lang)) {
            $lang = new Lang($lang);
        }

        $this->translatableLang = $lang;

        return $this;
    }
436991
public function create()
    {
        $params = array(
            'slug' => $this->ensureParameter('slug'),
            'name' => $this->ensureParameter('name'),
            'i18n_type' => $this->ensureParameter('i18nType'),
            'content' => $this->ensureParameter('content'),
        );

        $this->post(
            sprintf('project/%s/resources/', $this->ensureParameter('project')),
            $params
        );

        return $this;
    }
1256308
public function setLevel($level)
    {
        switch ($level) {
            case 'error':
                $this->logLevel = Project::MSG_ERR;
                break;
            case 'warning':
                $this->logLevel = Project::MSG_WARN;
                break;
            case 'info':
                $this->logLevel = Project::MSG_INFO;
                break;
            case 'verbose':
                $this->logLevel = Project::MSG_VERBOSE;
                break;
            case 'debug':
                $this->logLevel = Project::MSG_DEBUG;
                break;
            default:
                throw new BuildException(
                    sprintf('Unknown log level "%s"', $level)
                );
        }
    }
1277640
public function setProjectToken($token)
    {
        if (!$token) {
            throw new InvalidArgumentException('Project token required');
        } elseif (strlen($token) !== 32) {
            throw new InvalidArgumentException('Project token must be 32 characters length');
        }

        $this->projectToken = $token;

        return $this;
    }
976715
public function createProject(Project $project)
    {
        $request = $this->client->createRequest('POST', '/api/projects', null, array('insight_project' => $project->toArray()));

        return $this->serializer->deserialize(
            (string) $this->send($request)->getBody(),
            'SensioLabs\Insight\Sdk\Model\Project',
            'xml'
        );
    }
302892
public function setSource($source)
    {
        if (!$source instanceof Collection) {
            $source = collect($source);
        }

        $this->source = $source;
        return $this;
    }