### Set Employment Start Date Examples Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/work-builder.md Examples demonstrating how to set the employment start date using different input types. ```php ->startDate('2020-01-15') ->startDate(new DateTimeImmutable('2020-01-15')) ``` -------------------------------- ### Resume Creation and Usage Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume.md Demonstrates how to build a Resume object using ResumeBuilder, set basic information, validate it, get insights, and export it to JSON. ```php use JustSteveKing\Resume\Builders\ResumeBuilder; use JustSteveKing\Resume\DataObjects\Basics; use JustSteveKing\Resume\ValueObjects\Email; $basics = new Basics( name: 'Jane Smith', label: 'Senior Engineer', email: new Email('jane@example.com'), ); $resume = (new ResumeBuilder()) ->basics($basics) ->build(); // Validate $resume->validate(); // Get insights $years = $resume->getInsights()->getTotalYearsExperience(); // Export to JSON $json = json_encode($resume, JSON_PRETTY_PRINT); ``` -------------------------------- ### Example Resume Validation Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/configuration.md An example of how to use the CLI to validate a resume.json file. ```bash ./vendor/bin/resume validate resume.json ``` -------------------------------- ### Resume Exporter Usage Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/exporters.md Shows a comprehensive example of loading a resume from JSON and exporting it to Markdown, JSON-LD, and YAML formats using their respective exporters. ```php use JustSteveKing\Resume\Factories\ResumeFactory; use JustSteveKing\Resume\Exporters\MarkdownExporter; use JustSteveKing\Resume\Exporters\JsonLdExporter; use JustSteveKing\Resume\Exporters\YamlExporter; $resume = ResumeFactory::fromJson(file_get_contents('resume.json')); // Export to Markdown $mdExporter = new MarkdownExporter(); file_put_contents('resume.md', $mdExporter->export($resume)); // Export to JSON-LD $ldExporter = new JsonLdExporter(); $jsonLd = json_encode($ldExporter->export($resume), JSON_PRETTY_PRINT); file_put_contents('resume.jsonld', $jsonLd); // Export to YAML $yamlExporter = new YamlExporter(); file_put_contents('resume.yaml', $yamlExporter->export($resume)); // Export to JSON (built-in) file_put_contents('resume.json', json_encode($resume, JSON_PRETTY_PRINT)); ``` -------------------------------- ### Add Work Highlight Examples Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/work-builder.md Examples of adding multiple highlights to a work experience entry. ```php ->addHighlight('Improved performance by 40%') ->addHighlight('Led team of 5 engineers') ->addHighlight('Mentored 3 junior developers') ``` -------------------------------- ### Install Resume PHP via Composer Source: https://github.com/juststeveking/resume-php/blob/main/README.md Use this command to add the Resume PHP library to your project dependencies. ```bash composer require juststeveking/resume-php ``` -------------------------------- ### Install Composer Dependencies Source: https://github.com/juststeveking/resume-php/blob/main/GEMINI.md Installs the project's dependencies using Composer. Ensure PHP 8.4 and Composer are installed prior to running this command. ```bash composer install ``` -------------------------------- ### ResumeBuilder Constructor Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-builder.md Initializes a new, empty ResumeBuilder instance. No setup is required before use. ```php public function __construct() ``` -------------------------------- ### Full Job Description Builder Usage Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/job-description-builder.md A comprehensive example demonstrating the usage of the JobDescriptionBuilder to create a detailed job description object. It includes setting name, location, description, highlights, skills, tools, responsibilities, and deliverables before building the final object and encoding it to JSON. ```php use JustSteveKing\Resume\Builders\JobDescriptionBuilder; $jobDesc = (new JobDescriptionBuilder()) ->name('Senior PHP Backend Engineer') ->location('Remote') ->description('We are looking for an experienced PHP engineer to lead our backend infrastructure transition to microservices.') ->addHighlight('Competitive salary: $150k-$200k') ->addHighlight('Flexible work hours and remote-first culture') ->addHighlight('Professional development budget') ->addHighlight('Health insurance and 401k matching') ->addSkill('PHP 8+') ->addSkill('Laravel or Symfony') ->addSkill('REST API design') ->addSkill('Microservices architecture') ->addSkill('SQL databases (PostgreSQL/MySQL)') ->addSkill('Docker') ->addTool('Docker') ->addTool('Kubernetes') ->addTool('AWS or GCP') ->addTool('PostgreSQL') ->addTool('Git') ->addResponsibility('Design and implement scalable REST APIs') ->addResponsibility('Lead architectural decisions for backend systems') ->addResponsibility('Conduct code reviews and mentor junior developers') ->addResponsibility('Participate in agile ceremonies and sprint planning') ->addResponsibility('Collaborate with DevOps on infrastructure improvements') ->addDeliverable('Production-ready code with comprehensive test coverage') ->addDeliverable('Scalable, maintainable architecture documentation') ->addDeliverable('Mentorship plan for junior team members') ->build(); // Convert to JSON $json = json_encode($jobDesc, JSON_PRETTY_PRINT); ``` -------------------------------- ### Create Language Data Objects Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/data-objects.md Examples of instantiating Language data objects with different fluency levels. ```php new Language(language: 'English', fluency: 'Native') new Language(language: 'Spanish', fluency: 'Fluent') new Language(language: 'French', fluency: 'Intermediate') ``` -------------------------------- ### Create Skill Data Object Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/data-objects.md Example of instantiating a Skill data object, specifying the skill name, level, and associated keywords. Requires importing SkillLevel. ```php use JustSteveKing\Resume\Enums\SkillLevel; new Skill( name: 'PHP', level: SkillLevel::Expert, keywords: ['Laravel', 'Symfony', 'API Development', 'TDD'], ) ``` -------------------------------- ### ResumeFactory Usage Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-factory.md Demonstrates loading a resume from a JSON string, validating it, exporting it to Markdown, and retrieving insights like total years of experience and job titles. ```php use JustSteveKing\Resume\Factories\ResumeFactory; // Load from file $jsonString = file_get_contents('my-resume.json'); $resume = ResumeFactory::fromJson($jsonString); // Validate and export if ($resume->validate()) { $markdown = $resume->toMarkdown(); echo $markdown; } // Get insights $insights = $resume->getInsights(); echo "Years of experience: " . $insights->getTotalYearsExperience(); // List all job titles $titles = $insights->getUniqueJobTitles(); foreach ($titles as $title) { echo "- $title\n"; } ``` -------------------------------- ### Create Education Data Object Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/data-objects.md Example of instantiating an Education data object, including the necessary import for EducationLevel. ```php use JustSteveKing\Resume\Enums\EducationLevel; new Education( institution: 'MIT', area: 'Computer Science', studyType: EducationLevel::Bachelor, startDate: '2014-09-01', endDate: '2018-06-01', score: '3.8', courses: ['Data Structures', 'Algorithms', 'Computer Networks'], ) ``` -------------------------------- ### ResumeBuilder Class Documentation Excerpt Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/MANIFEST.md This markdown excerpt shows the documentation structure for the ResumeBuilder class, including its constructor, methods, parameters, return types, and example usage. ```markdown # ResumeBuilder Fluent builder for constructing a `Resume` instance. ## Constructor public function __construct() Creates a new empty ResumeBuilder instance. ## Methods ### basics() Sets the basics section of the resume or returns a nested BasicsBuilder. public function basics(?Basics $basics = null): ResumeBuilder|BasicsBuilder | Parameter | Type | Default | Description | |-----------|------|---------|-------------| | $basics | `Basics|null` | `null` | Optional Basics instance. | **Return:** `ResumeBuilder` if `$basics` is provided, `BasicsBuilder` otherwise. **Example:** ... ``` -------------------------------- ### Interest Data Object Constructor and Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/data-objects.md Models an area of interest or hobby. It takes a name and an array of keywords. This example shows how to instantiate the Interest object. ```php public function __construct( string $name, array $keywords = [], ) new Interest(name: 'Machine Learning', keywords: ['Neural Networks', 'Deep Learning']) ``` -------------------------------- ### WorkBuilder::startDate() Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/work-builder.md Sets the employment start date. ```APIDOC ## WorkBuilder::startDate() ### Description Sets the employment start date. ### Method `startDate(string|DateTimeImmutable $startDate): self` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **$startDate** (`string` or `DateTimeImmutable`) - Required - Start date in any format parseable by DateTimeImmutable or ISO 8601 (YYYY-MM-DD). ### Return `self` for method chaining. ### Example ```php ->startDate('2020-01-15') ->startDate(new DateTimeImmutable('2020-01-15')) ``` ``` -------------------------------- ### YamlExporter Usage Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/exporters.md Demonstrates creating a YamlExporter and exporting a Resume object to YAML, including saving to a file and using custom formatting options. ```php use JustSteveKing\Resume\Exporters\YamlExporter; $exporter = new YamlExporter(); $yaml = $exporter->export($resume); file_put_contents('resume.yaml', $yaml); // Or with custom formatting $yaml = $exporter->export($resume, inline: 5, indent: 4); ``` -------------------------------- ### Create Work Data Object Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/data-objects.md Example of instantiating a Work data object with essential and optional details. ```php new Work( name: 'Tech Corp', position: 'Senior Engineer', location: 'Remote', startDate: '2020-01-15', endDate: '2023-12-31', summary: 'Led backend development', highlights: ['Improved performance by 40%', 'Led team of 5'], ) ``` -------------------------------- ### Build a Résumé with Data Objects Source: https://github.com/juststeveking/resume-php/blob/main/README.md Construct a resume object using strictly-typed Data Objects and Value Objects for validation. This example demonstrates creating the basics section and adding work experience. ```php use JustSteveKing\Resume\Builders\ResumeBuilder; use JustSteveKing\Resume\DataObjects\Basics; use JustSteveKing\Resume\DataObjects\Location; use JustSteveKing\Resume\DataObjects\Profile; use JustSteveKing\Resume\Enums\Network; use JustSteveKing\Resume\ValueObjects\Email; use JustSteveKing\Resume\ValueObjects\Url; // Create the basics section using Value Objects for Email and URL $basics = new Basics( name: 'John Doe', label: 'Software Engineer', email: new Email('john@example.com'), url: new Url('https://johndoe.com'), summary: 'Experienced software engineer with 5+ years in web development.', location: new Location( address: '123 Main St', postalCode: '94105', city: 'San Francisco', countryCode: 'US', region: 'CA', ), profiles: [ new Profile(Network::GitHub, 'johndoe', new Url('https://github.com/johndoe')), new Profile(Network::LinkedIn, 'johndoe', new Url('https://linkedin.com/in/johndoe')), ], ); // Build the résumé fluently $resume = (new ResumeBuilder()) ->basics($basics) ->addWork(new \JustSteveKing\Resume\DataObjects\Work( name: 'Tech Corp', position: 'Senior Developer', startDate: '2020-01-01', summary: 'Led development of core platform features', highlights: ['Improved performance by 40%', 'Mentored junior developers'], )) ->build(); // Validate against the official JSON schema $isValid = $resume->validate(); // Convert to schema-compliant JSON $json = json_encode($resume, JSON_PRETTY_PRINT); ``` -------------------------------- ### MarkdownExporter Usage Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/exporters.md Demonstrates how to instantiate MarkdownExporter and use its export method to convert a Resume object to Markdown, with and without custom options. ```php use JustSteveKing\Resume\Exporters\MarkdownExporter; $exporter = new MarkdownExporter(locale: 'en'); $markdown = $exporter->export($resume); echo $markdown; // Or with custom options $markdown = $exporter->export($resume, [ 'work' => true, 'education' => true, 'skills' => false, ]); ``` -------------------------------- ### JsonLdExporter Usage Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/exporters.md Shows how to create a JsonLdExporter, export a Resume object, and then encode the resulting array into a pretty-printed JSON string. ```php use JustSteveKing\Resume\Exporters\JsonLdExporter; $exporter = new JsonLdExporter(); $jsonLd = $exporter->export($resume); $json = json_encode($jsonLd, JSON_PRETTY_PRINT); echo $json; // Output: // { // "@context": "https://schema.org", // "@type": "Person", // "name": "John Doe", // "jobTitle": "Senior Engineer", // "knowsAbout": ["PHP", "JavaScript", "AWS"] // } ``` -------------------------------- ### Add Education and Skills to Résumé Source: https://github.com/juststeveking/resume-php/blob/main/README.md Extend the resume builder by adding education entries and skill sets. This example shows how to instantiate and add Education and Skill objects. ```php use JustSteveKing\Resume\DataObjects\Education; use JustSteveKing\Resume\DataObjects\Skill; use JustSteveKing\Resume\Enums\EducationLevel; use JustSteveKing\Resume\Enums\SkillLevel; $resumeBuilder = (new ResumeBuilder())->basics($basics); $resumeBuilder->addEducation(new Education( institution: 'University of Technology', area: 'Computer Science', studyType: EducationLevel::Bachelor, startDate: '2014-09-01', endDate: '2018-06-01', )); $resumeBuilder->addSkill(new Skill( name: 'PHP', level: SkillLevel::Expert, keywords: ['Laravel', 'Symfony', 'API Development'], )); $resume = $resumeBuilder->build(); ``` -------------------------------- ### Instantiate and Serialize Basics Data Object Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/basics.md Example of creating a new Basics data object with various details and then serializing it to a pretty-printed JSON string. Note that Email and Url parameters must be passed as value objects. ```php use JustSteveKing\Resume\DataObjects\Basics; use JustSteveKing\Resume\DataObjects\Location; use JustSteveKing\Resume\DataObjects\Profile; use JustSteveKing\Resume\Enums\Network; use JustSteveKing\Resume\ValueObjects\Email; use JustSteveKing\Resume\ValueObjects\Url; $basics = new Basics( name: 'John Doe', label: 'Senior Software Engineer', email: new Email('john@example.com'), phone: '+1 (555) 123-4567', url: new Url('https://johndoe.com'), summary: 'Experienced full-stack engineer with 10+ years in web development', image: new Url('https://johndoe.com/photo.jpg'), location: new Location( address: '123 Main St', postalCode: '94105', city: 'San Francisco', region: 'CA', countryCode: 'US', ), profiles: [ new Profile( network: Network::GitHub, username: 'johndoe', url: new Url('https://github.com/johndoe'), ), new Profile( network: Network::LinkedIn, username: 'johndoe', url: new Url('https://linkedin.com/in/johndoe'), ), ], ); // Serialize to JSON $json = json_encode($basics, JSON_PRETTY_PRINT); ``` -------------------------------- ### Project Data Object Constructor Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/data-objects.md Defines a project, including its name, optional start and end dates, description, highlights, and a URL. Useful for detailing personal or professional projects. ```php public function __construct( string $name, string|DateTimeImmutable|null $startDate = null, string|DateTimeImmutable|null $endDate = null, ?string $description = null, array $highlights = [], ?Url $url = null, ) ``` -------------------------------- ### Handle CLI Locale Argument in PHP Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/configuration.md Example of how to accept and use a locale option from the CLI arguments within a PHP application. ```php // Accept locale as CLI argument $locale = $input->getOption('locale') ?? 'en'; $exporter = new MarkdownExporter(locale: $locale); ``` -------------------------------- ### Get Resume Summary Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume.md Returns an array containing statistics and content summary of the resume, including counts of work experiences, education entries, skills, and projects. Useful for quick overviews. ```php public function getSummary(): array ``` ```php $summary = $resume->getSummary(); echo "Name: " . $summary['name']; echo "Experience: " . $summary['work_experiences'] . " positions"; ``` -------------------------------- ### Add Work Experience to Resume Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/work-builder.md Use the ResumeBuilder to add multiple work experiences, including details like company name, position, dates, summary, and highlights. Ensure the 'basics' variable is defined before starting the builder. ```php use JustSteveKing\Resume\Builders\ResumeBuilder; $resume = (new ResumeBuilder()) ->basics($basics) ->addWork() ->name('Tech Corp') ->position('Senior Software Engineer') ->location('Remote') ->url('https://techcorp.com') ->startDate('2020-01-15') ->endDate('2023-12-31') ->summary('Led development of core platform features and infrastructure') ->addHighlight('Architected microservices reducing latency by 60%') ->addHighlight('Led team of 5 backend engineers') ->addHighlight('Established code review standards') ->end() ->addWork() ->name('StartupXYZ') ->position('Full Stack Developer') ->location('San Francisco, CA') ->startDate('2018-06-01') ->endDate('2020-01-14') ->summary('Built web application from scratch using Laravel and React') ->addHighlight('Launched MVP in 3 months') ->addHighlight('Grew user base to 10k active users') ->end() ->build(); ``` -------------------------------- ### build() Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-builder.md Constructs and returns the final Resume instance. Throws LogicException if basics are not set. ```APIDOC ## build() ### Description Constructs and returns the final Resume instance. ### Method `public function build(): Resume` ### Throws `LogicException` if the basics section is not set. ### Example ```php $resume = (new ResumeBuilder()) ->basics($basics) ->addWork($work) ->addSkill($skill) ->build(); ``` ### Return `Resume` The fully constructed resume object. ``` -------------------------------- ### Build Resume Instance Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-builder.md Constructs and returns the final Resume instance. Throws a LogicException if the basics section is not set. ```php public function build(): Resume ``` ```php $resume = (new ResumeBuilder()) ->basics($basics) ->addWork($work) ->addSkill($skill) ->build(); ``` -------------------------------- ### Build Basics Instance Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/basics-builder.md Constructs and returns the Basics instance. String parameters are automatically converted to Url/Email value objects. ```php public function build(): Basics ``` -------------------------------- ### basics() Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-builder.md Sets the basics section of the resume or returns a nested BasicsBuilder for fluent construction. Throws LogicException if build() is called without basics being set. ```APIDOC ## basics() ### Description Sets the basics section of the resume or returns a nested BasicsBuilder. ### Method `public function basics(?Basics $basics = null): ResumeBuilder|BasicsBuilder` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **$basics** (`Basics`|`null`) - Optional - The Basics instance to set. If null, a BasicsBuilder is returned. ### Return `ResumeBuilder` if `$basics` is provided, `BasicsBuilder` otherwise for chaining nested builders. ### Throws `LogicException` when `build()` is called without basics being set. ### Example ```php // Direct assignment $resume = (new ResumeBuilder()) ->basics(new Basics(name: 'John Doe', label: 'Engineer')) ->build(); // Fluent builder pattern $resume = (new ResumeBuilder()) ->basics() ->name('John Doe') ->label('Engineer') ->email('john@example.com') ->end() ->build(); ``` ``` -------------------------------- ### Set Employment Start Date Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/work-builder.md Sets the employment start date. Accepts a string or DateTimeImmutable object. Returns self for method chaining. ```php public function startDate(string|DateTimeImmutable $startDate): self ``` -------------------------------- ### Get Resume Insights Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume.md Retrieves a CareerAnalyzer service to analyze career data such as total years of experience. Call this method to get career analytics. ```php public function getInsights(): CareerAnalyzer ``` ```php $resume = ResumeFactory::fromJson($json); $insights = $resume->getInsights(); echo $insights->getTotalYearsExperience(); // 8.5 ``` -------------------------------- ### Create a Resume with Basic Information Source: https://github.com/juststeveking/resume-php/blob/main/resume-php/references/examples.md Builds a resume object by setting basic personal details, contact information, location, and social profiles. ```php use JustSteveKing\Resume\Builders\ResumeBuilder; use JustSteveKing\Resume\DataObjects\Location; use JustSteveKing\Resume\DataObjects\Profile; use JustSteveKing\Resume\Enums\Network; $builder = new ResumeBuilder(); $builder->basics() ->setName('Steve McDougall') ->setLabel('Software Engineer') ->setEmail('steve@example.com') ->setUrl('https://steve.com') ->setSummary('Experienced PHP developer focused on developer experience.') ->setLocation(new Location( city: 'Caerphilly', countryCode: 'UK', region: 'Wales', )) ->addProfile(new Profile( network: Network::GITHUB, username: 'juststeveking', url: 'https://github.com/juststeveking', )); $builder->addWork() ->setName('Acme Corp') ->setPosition('Senior Developer') ->setStartDate('2022-01-01') ->setSummary('Leading development of core products.') ->addHighlight('Implemented JSON Resume support'); $resume = $builder->build(); ``` -------------------------------- ### PHP Field Attribute Usage Example Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/types.md Example demonstrating the application of the Field attribute to a property to specify its corresponding JSON field name. This is for internal use. ```php #[Field('startDate')] public ?DateTimeImmutable $startDate = null; ``` -------------------------------- ### build() Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/basics-builder.md Constructs and returns the Basics instance. Throws InvalidArgumentException if email format is invalid. ```APIDOC ## build() ### Description Constructs and returns the Basics instance. ### Method ```php public function build(): Basics ``` ### Return `Basics` instance. ### Throws String parameters are automatically converted to Url/Email value objects. ``` -------------------------------- ### Translator::getInstance Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/services.md Gets the singleton instance of the Translator service, allowing for language localization. You can specify the desired locale. ```APIDOC ## getInstance(string $locale = 'en'): self ### Description Gets the singleton Translator instance for localization support. ### Method `public static function getInstance(string $locale = 'en'): self` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Parameters - **locale** (`string`) - Optional - The language locale to use (e.g., 'en', 'cy'). Defaults to 'en'. ### Return - `self`: The singleton Translator instance. ### Example: ```php use JustSteveKing\Resume\Services\Translator; $translator = Translator::getInstance('en'); ``` ``` -------------------------------- ### BasicsBuilder Methods Source: https://github.com/juststeveking/resume-php/blob/main/resume-php/references/api-reference.md Methods for configuring the basics section of a resume. ```APIDOC ## BasicsBuilder ### `setName(string $name): self` Sets the name for the resume basics. ### `setLabel(string $label): self` Sets the label for the resume basics. ### `setImage(string $image): self` Sets the image URL for the resume basics. ### `setEmail(string $email): self` Sets the email address for the resume basics. ### `setPhone(string $phone): self` Sets the phone number for the resume basics. ### `setUrl(string $url): self` Sets the personal URL for the resume basics. ### `setSummary(string $summary): self` Sets the summary for the resume basics. ### `setLocation(Location $location): self` Sets the location details for the resume basics. ### `addProfile(Profile $profile): self` Adds a profile link (e.g., social media) to the resume basics. ### `build(): Basics` Builds and returns the configured `Basics` object. ``` -------------------------------- ### Get Translator Instance Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/services.md Retrieves a singleton instance of the Translator service for localization. Allows specifying a language locale. ```php public static function getInstance(string $locale = 'en'): self ``` ```php use JustSteveKing\Resume\Services\Translator; $translator = Translator::getInstance('en'); ``` -------------------------------- ### Get Unique Job Titles Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/services.md Extracts a list of all unique job titles from the work history section of a resume. ```php public function getUniqueJobTitles(): array ``` ```php $titles = $insights->getUniqueJobTitles(); foreach ($titles as $title) { echo "- $title\n"; } // Output: // - Senior Developer // - Full Stack Engineer // - Junior Developer ``` -------------------------------- ### Build Resume Basics Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/basics-builder.md Constructs a resume object by defining basic information using the ResumeBuilder. Includes personal details, contact methods, and social network profiles. ```php use JustSteveKing\Resume\Builders\ResumeBuilder; use JustSteveKing\Resume\Enums\Network; use JustSteveKing\Resume\ValueObjects\Email; use JustSteveKing\Resume\ValueObjects\Url; $resume = (new ResumeBuilder()) ->basics() ->name('John Doe') ->label('Software Engineer') ->email('john@example.com') ->phone('+1 234 567 8900') ->url('https://johndoe.com') ->summary('Experienced full-stack developer with 8+ years') ->location() ->address('123 Main St') ->city('San Francisco') ->region('CA') ->countryCode('US') ->end() ->addProfile() ->network(Network::GitHub) ->username('johndoe') ->url('https://github.com/johndoe') ->end() ->addProfile() ->network(Network::LinkedIn) ->username('johndoe') ->url('https://linkedin.com/in/johndoe') ->end() ->end() ->build(); ``` -------------------------------- ### Handling LogicException in ResumeBuilder Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/errors.md Demonstrates catching a LogicException when calling build() on ResumeBuilder without setting the required 'basics' section. This ensures proper state management before building a resume. ```php use JustSteveKing\Resume\Builders\ResumeBuilder; use LogicException; try { $resume = (new ResumeBuilder()) ->addWork($work) ->build(); // Error: basics not set } catch (LogicException $e) { echo "Build failed: " . $e->getMessage(); // "Basics section is required" } ``` -------------------------------- ### Get Skill Frequency Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/services.md Analyzes and counts the frequency of each skill mentioned in work highlights and summaries. Skill matching is case-insensitive and results are sorted by frequency. ```php public function getSkillFrequency(): array ``` ```php $frequencies = $insights->getSkillFrequency(); foreach ($frequencies as $skill => $count) { echo "$skill: $count mentions\n"; } // Output: // php: 5 mentions // javascript: 4 mentions // docker: 3 mentions ``` -------------------------------- ### Profile Creation with Network Enum Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/types.md Demonstrates how to create a Profile object using the Network enum for the network field. Ensure the Profile class is imported. ```php use JustSteveKing\Resume\Enums\Network; new Profile(network: Network::GitHub, username: 'johndoe') new Profile(network: Network::LinkedIn, username: 'johndoe') ``` -------------------------------- ### Documentation Structure by Task Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/README.md This section organizes the documentation by common tasks users might perform with the library, guiding them through the relevant classes and concepts for each workflow. ```APIDOC ## Documentation Structure ### By Task **Building a Resume from Scratch:** 1. `ResumeBuilder` — Main fluent API 2. `BasicsBuilder` — Required basics section 3. `WorkBuilder` — Add work experience 4. Data Objects — Create specific entries (Education, Skill, etc.) 5. Types — Enums and value objects **Loading an Existing Resume:** 1. `ResumeFactory` — Load from JSON/YAML/array 2. Types — Understand data structure 3. Errors — Handle loading failures **Validating & Exporting:** 1. `Resume` — `validate()` and export methods 2. Services (`Validator`) — Validator service 3. Exporters — Output formats (Markdown, YAML, JSON-LD) 4. Services (`CareerAnalyzer`) — Analyze resume data **CLI Tooling:** 1. Configuration — CLI options and arguments 2. Exporters — Supported formats ``` -------------------------------- ### Profile Constructor Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/data-objects.md Initialize a Profile object for a social media account, including the network, username, and an optional URL. ```php public function __construct( Network $network, string $username, ?Url $url = null, ) ``` ```php use JustSteveKing\Resume\Enums\Network; new Profile( network: Network::GitHub, username: 'johndoe', url: new Url('https://github.com/johndoe'), ) ``` -------------------------------- ### Resume Constructor Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume.md Initializes a Resume object with various sections of a resume. All parameters are public readonly properties. ```php public function __construct( Basics $basics, array $work = [], array $volunteer = [], array $education = [], array $awards = [], array $certificates = [], array $publications = [], array $skills = [], array $languages = [], array $interests = [], array $references = [], array $projects = [], ResumeSchema $schema = ResumeSchema::V1, ) ``` -------------------------------- ### Core Entry Points Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/README.md This section outlines the primary classes for interacting with the Resume PHP library, categorized by their function: building resumes, loading existing ones, main data objects, exporting, and services for analysis and validation. ```APIDOC ## Core Entry Points ### Building Resumes - **`ResumeBuilder`**: Fluent builder for constructing Resume instances. - **`BasicsBuilder`**: Nested builder for the basics section (contact info, profiles). - **`WorkBuilder`**: Nested builder for work experience entries. - **`JobDescriptionBuilder`**: Builder for job postings/specifications. ### Loading Existing Resumes - **`ResumeFactory`**: Static factory for hydrating Resume from JSON/YAML/array. ### Main Data Objects - **`Resume`**: Root resume data structure. - **`Basics`**: Basics section (name, label, contact). - **[All Data Objects](api-reference/data-objects.md)**: Covers Work, Education, Skill, Language, Award, Certificate, Publication, Project, Volunteer, Interest, Reference, Location, Profile. ### Exporting & Transforming - **`MarkdownExporter`**: Export to human-readable Markdown. - **`YamlExporter`**: Export to YAML format. - **`JsonLdExporter`**: Export to JSON-LD (schema.org/Person). ### Services & Analysis - **`CareerAnalyzer`**: Calculate experience, skills, gaps, job titles. - **`Validator`**: Validate resume against JSON schema. - **`Translator`**: Translation service for localization. ``` -------------------------------- ### Get Work Gaps Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/services.md Identifies and returns periods of unemployment greater than 30 days between work entries. It sorts entries by date and ignores entries with missing dates. ```php public function getWorkGaps(): array ``` ```php $gaps = $insights->getWorkGaps(); if (!empty($gaps)) { echo "Employment gaps detected:\n"; foreach ($gaps as $gap) { echo " {$gap['start']} to {$gap['end']} ({$gap['days']} days)\n"; } } else { echo "No employment gaps found"; } ``` -------------------------------- ### CareerAnalyzer::getWorkGaps Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/services.md Identifies periods of unemployment or gaps in work history that are greater than 30 days. It returns an array of gap periods, detailing the start, end, and duration in days. ```APIDOC ## getWorkGaps() ### Description Identifies periods of unemployment or gaps in work history (greater than 30 days). ### Method `public function getWorkGaps(): array` ### Parameters None ### Return - `array`: Array of gap periods, each with: - `start`: Start date of gap (Y-m-d format) - `end`: End date of gap (Y-m-d format) - `days`: Number of days in gap ### Behavior: - Sorts work entries by start date - Only reports gaps > 30 days - Ignores entries without start or end dates - Returns empty array if no gaps found ### Example: ```php $gaps = $insights->getWorkGaps(); if (!empty($gaps)) { echo "Employment gaps detected:\n"; foreach ($gaps as $gap) { echo " {$gap['start']} to {$gap['end']} ({$gap['days']} days)\n"; } } else { echo "No employment gaps found"; } ``` ``` -------------------------------- ### Set Basics Section (Fluent Builder) Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-builder.md Uses the nested BasicsBuilder for fluent construction of the basics section. Call `end()` to return to the ResumeBuilder. ```php $resume = (new ResumeBuilder()) ->basics() ->name('John Doe') ->label('Engineer') ->email('john@example.com') ->end() ->build(); ``` -------------------------------- ### Get Total Years of Experience Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/services.md Calculates the total years of work experience from resume entries. It handles entries without end dates by using the current date and rounds the result to one decimal place. ```php public function getTotalYearsExperience(): float ``` ```php $resume = ResumeFactory::fromJson($jsonString); $insights = $resume->getInsights(); $years = $insights->getTotalYearsExperience(); echo "Total experience: {$years} years"; // e.g., "8.5 years" ``` -------------------------------- ### Add Project to ResumeBuilder Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-builder.md Adds a project entry to the resume builder. Returns the builder instance for chaining. ```php public function addProject(Project $project): ResumeBuilder ``` -------------------------------- ### Directly Construct Resume Object Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/README.md Instantiate a Resume object directly by providing all necessary data objects. This is useful when you have all data readily available. ```php $resume = new Resume( basics: $basics, work: [$work1, $work2], education: [$education], skills: [$skill1, $skill2], ); ``` -------------------------------- ### Create Resume from YAML String Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-factory.md Use this method to create a Resume instance from a YAML string. The YAML string should follow the JSON Resume schema structure. Throws HydrationException on invalid YAML or missing fields. ```php use JustSteveKing\Resume\Factories\ResumeFactory; $yaml = file_get_contents('resume.yaml'); $resume = ResumeFactory::fromYaml($yaml); ``` -------------------------------- ### CareerAnalyzer::getTotalYearsExperience Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/services.md Calculates the total years of work experience from all work entries in a resume. It considers start and end dates, using the current date for entries without an end date, and returns the result rounded to one decimal place. ```APIDOC ## getTotalYearsExperience() ### Description Calculates total years of work experience from all work entries. ### Method `public function getTotalYearsExperience(): float` ### Parameters None ### Return - `float`: Total years as float (e.g., 8.5), calculated from work entries' start and end dates. ### Behavior: - Uses actual day differences divided by 365.25 - For entries without endDate, uses current date - Returns 0 if no work entries or all dates are null - Result is rounded to 1 decimal place ### Example: ```php $resume = ResumeFactory::fromJson($jsonString); $insights = $resume->getInsights(); $years = $insights->getTotalYearsExperience(); echo "Total experience: {$years} years"; // e.g., "8.5 years" ``` ``` -------------------------------- ### Set Personal Website or Portfolio URL Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/basics-builder.md Sets the personal website or portfolio URL. Returns self for method chaining. ```php public function url(string|Url|null $url): self ``` -------------------------------- ### Education Creation with EducationLevel Enum Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/types.md Shows how to instantiate an Education object, specifying the study type using the EducationLevel enum. The institution is also required. ```php use JustSteveKing\Resume\Enums\EducationLevel; new Education( institution: 'MIT', studyType: EducationLevel::Bachelor, ) ``` -------------------------------- ### Export Resume to Markdown (English) Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/configuration.md Use the CLI to export a resume.json file to Markdown format with the default English locale. ```bash ./vendor/bin/resume export resume.json --format=markdown ``` -------------------------------- ### ResumeBuilder API Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/MANIFEST.md Documentation for the ResumeBuilder class, which provides a fluent API for constructing a Resume instance. It includes details on its constructor and methods like `basics()`. ```APIDOC ## ResumeBuilder API ### Description Fluent builder for constructing a `Resume` instance. This class allows for the programmatic creation of resume data structures. ### Constructor `public function __construct()` Creates a new empty ResumeBuilder instance. ### Methods #### basics() Sets the basics section of the resume or returns a nested BasicsBuilder. `public function basics(?Basics $basics = null): ResumeBuilder|BasicsBuilder` **Parameters:** - **$basics** (`Basics|null`) - Required/Optional - Optional Basics instance. **Return:** `ResumeBuilder` if `$basics` is provided, `BasicsBuilder` otherwise. **Example:** (Example usage would be detailed here in the actual documentation) ``` -------------------------------- ### Export Resume to Markdown (Welsh) Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/configuration.md Use the CLI to export a resume.json file to Markdown format, specifying the Welsh locale. ```bash ./vendor/bin/resume export resume.json --format=markdown --locale=cy ``` -------------------------------- ### Fluent Builder with Inline Nesting Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/README.md Demonstrates a fluent builder pattern for constructing a resume object with nested sections like basics and work experience. This approach allows for a more readable and chained method calls. ```php $resume = (new ResumeBuilder()) ->basics() ->name('John Doe') ->label('Engineer') ->email('john@example.com') ->location() ->city('San Francisco') ->countryCode('US') ->end() ->end() ->addWork() ->name('Company') ->position('Developer') ->end() ->build(); ``` -------------------------------- ### fromYaml Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-factory.md Creates a Resume instance from a YAML string. It expects a valid YAML string structured like the JSON Resume schema and may throw a HydrationException for invalid data. ```APIDOC ## fromYaml ### Description Creates a Resume instance from a YAML string. ### Method `public static function fromYaml(string $yaml): Resume` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **$yaml** (string) - Required - Valid YAML string following JSON Resume schema structure. ### Request Example ```php $yaml = file_get_contents('resume.yaml'); $resume = ResumeFactory::fromYaml($yaml); ``` ### Response #### Success Response * **Resume** - A Resume instance. #### Response Example (No specific example provided in source, but returns a Resume object) ### Throws * `HydrationException` - if YAML is invalid or required fields are missing. ``` -------------------------------- ### Configure Location Details Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/basics-builder.md Returns a nested LocationBuilder for setting location details. Use end() to return to the BasicsBuilder. ```php public function location(): LocationBuilder ``` ```php $resume = (new ResumeBuilder()) ->basics() ->name('John Doe') ->location() ->city('San Francisco') ->countryCode('US') ->end() ->end() ->build(); ``` -------------------------------- ### Set All Tools or Technologies Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/job-description-builder.md Sets all tools or technologies at once using an array. Returns self for method chaining. ```php public function tools(array $tools): JobDescriptionBuilder ``` -------------------------------- ### Set Basics Section (Direct Assignment) Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-builder.md Directly assigns a pre-constructed Basics object to the resume. Ensure the Basics object is valid. ```php $resume = (new ResumeBuilder()) ->basics(new Basics(name: 'John Doe', label: 'Engineer')) ->build(); ``` -------------------------------- ### Resume Creation Error Handling Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/errors.md Demonstrates how to handle InvalidArgumentException during email validation and LogicException for missing required resume sections when building a resume. ```php use JustSteveKing\Resume\Builders\ResumeBuilder; use JustSteveKing\Resume\DataObjects\Basics; use JustSteveKing\Resume\ValueObjects\Email; use LogicException; use InvalidArgumentException; try { $email = new Email('invalid'); // Validate immediately } catch (InvalidArgumentException $e) { // Handle email validation error return ['error' => $e->getMessage()]; } try { $resume = (new ResumeBuilder()) ->basics($basics) ->build(); } catch (LogicException $e) { // Handle missing required sections return ['error' => 'Resume incomplete: ' . $e->getMessage()]; } ``` -------------------------------- ### Export Resume to YAML Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/configuration.md Use the CLI to export a resume.json file to YAML format, specifying an output file name. ```bash ./vendor/bin/resume export resume.json --format=yaml --output=resume.yaml ``` -------------------------------- ### Export Resume using CLI Source: https://github.com/juststeveking/resume-php/blob/main/README.md Employs the command-line interface to export a resume file to different formats and locales. ```bash # Export to different formats ./vendor/bin/resume export my-resume.yaml --format=markdown --locale=en ./vendor/bin/resume export my-resume.json --format=json-ld --output=profile.jsonld ``` -------------------------------- ### Create Resume from JSON String Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume-factory.md Use this method to create a Resume instance from a JSON string. Ensure the JSON string adheres to the JSON Resume schema. Throws HydrationException on invalid JSON or missing fields. ```php use JustSteveKing\Resume\Factories\ResumeFactory; $json = file_get_contents('resume.json'); $resume = ResumeFactory::fromJson($json); ``` -------------------------------- ### url() Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/basics-builder.md Sets the personal website or portfolio URL. Returns self for method chaining. ```APIDOC ## url() ### Description Sets the personal website or portfolio URL. ### Method ```php public function url(string|Url|null $url): self ``` ### Parameters #### Path Parameters - **$url** (string|Url|null) - Required - Personal website URL. ### Return `self` for method chaining. ``` -------------------------------- ### Resume Constructor Source: https://github.com/juststeveking/resume-php/blob/main/_autodocs/api-reference/resume.md Constructs a new Resume object with various sections of a JSON Resume. All parameters are optional except for the basics section. ```APIDOC ## Constructor Resume ### Description Initializes a Resume object with core information and optional sections like work experience, education, skills, and more. It also allows specifying the JSON Resume schema version. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **$basics** (`Basics`) - Required - Basic information including name, label, and contact details. * **$work** (`list`) - Optional - A list of work experience entries. * **$volunteer** (`list`) - Optional - A list of volunteer experience entries. * **$education** (`list`) - Optional - A list of education entries. * **$awards** (`list`) - Optional - A list of awards received. * **$certificates** (`list`) - Optional - A list of obtained certifications. * **$publications** (`list`) - Optional - A list of published works. * **$skills** (`list`) - Optional - A list of skills and proficiencies. * **$languages** (`list`) - Optional - A list of spoken languages. * **$interests** (`list`) - Optional - A list of areas of interest. * **$references** (`list`) - Optional - A list of professional references. * **$projects** (`list`) - Optional - A list of personal or professional projects. * **$schema** (`ResumeSchema`) - Optional - The JSON Resume schema version to use, defaults to `ResumeSchema::V1`. ```